refactor: get rid of isNvidia
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-03-03 17:34:21 -05:00
parent 477ef7759a
commit 88d5d1bdd8
4 changed files with 6 additions and 11 deletions

View file

@ -6,9 +6,8 @@
}: let
inherit (lib) hasAttr optionals;
isNvidia = config.hardware.nvidia.modesetting.enable;
jellyPkgs =
if isNvidia
if config.nvidia.enableCUDA
then pkgs.cudaPackages.pkgs
else pkgs;
in {

View file

@ -20,7 +20,6 @@
inherit (import ./setupMonitors.nix {inherit config pkgs;}) setupMonitors;
# Nix stuff
isNvidia = config.hardware.nvidia.modesetting.enable;
cfgHypr = config.home-manager.users.${mainUser}.wayland.windowManager.hyprland;
devices = filterAttrs (n: v: hasPrefix "device:" n) cfgHypr.settings;
@ -44,7 +43,7 @@
attrs);
in {
hyprConf = pkgs.writeText "greetd-hypr-config" (
(optionalString isNvidia
(optionalString config.nvidia.enable
/*
hyprlang
*/

View file

@ -7,8 +7,6 @@
}: let
inherit (lib) concatStringsSep optionals;
inherit (config.vars) mainUser;
isNvidia = config.hardware.nvidia.modesetting.enable;
in {
# SYSTEM CONFIG
imports = [
@ -61,7 +59,7 @@ in {
"$XDG_DATA_DIRS"
]}"
]
++ (optionals isNvidia [
++ (optionals config.nvidia.enable [
"LIBVA_DRIVER_NAME, nvidia"
"XDG_SESSION_TYPE, wayland"
"GBM_BACKEND, nvidia-drm"

View file

@ -4,9 +4,8 @@
pkgs,
...
}: let
inherit (lib) makeLibraryPath optionalString;
inherit (config.vars) mainUser;
isNvidia = config.hardware.nvidia.modesetting.enable;
in {
imports = [../dolphin.nix];
@ -61,8 +60,8 @@ in {
];
buildInputs = [makeWrapper];
postBuild = ''
wrapProgram $out/bin/Discord ${lib.optionalString isNvidia
''--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [
wrapProgram $out/bin/Discord ${optionalString config.nvidia.enable
''--prefix LD_LIBRARY_PATH : "${makeLibraryPath [
addOpenGLRunpath.driverLink
libglvnd
]}"''} \