move nvidia relevant options into one file
This commit is contained in:
parent
f13fe6fc3a
commit
13db4b4d21
35
modules/nixos/system/hardware/gpu/nvidia/default.nix
Normal file
35
modules/nixos/system/hardware/gpu/nvidia/default.nix
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
options,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib;
|
||||||
|
with lib.wyrdgard; let
|
||||||
|
cfg = config.wyrdgard.system.hardware.gpu.nvidia;
|
||||||
|
in {
|
||||||
|
options.wyrdgard.system.hardware.gpu.nvidia = with types; {
|
||||||
|
enable = mkEnableOption "Enable Nvidia GPU";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
hardware.opengl = {
|
||||||
|
enable = true;
|
||||||
|
driSupport = true;
|
||||||
|
driSupport32Bit = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
hardware.nvidia = {
|
||||||
|
modesetting.enable = true;
|
||||||
|
powerManagement.enable = false;
|
||||||
|
powerManagement.finegrained = false;
|
||||||
|
open = false;
|
||||||
|
nvidiaSettings = false;
|
||||||
|
package = config.boot.kernelPackages.nvidiaPackages.beta; # stable, beta
|
||||||
|
};
|
||||||
|
|
||||||
|
services.xserver.videoDrivers = ["nvidia"];
|
||||||
|
services.xserver.displayManager.sddm.wayland.enable = lib.mkForce false;
|
||||||
|
};
|
||||||
|
}
|
|
@ -11,22 +11,6 @@ with lib.wyrdgard; {
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
];
|
];
|
||||||
|
|
||||||
# nvidia
|
|
||||||
hardware.opengl = {
|
|
||||||
enable = true;
|
|
||||||
driSupport = true;
|
|
||||||
driSupport32Bit = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
hardware.nvidia = {
|
|
||||||
modesetting.enable = true;
|
|
||||||
powerManagement.enable = false;
|
|
||||||
powerManagement.finegrained = false;
|
|
||||||
open = false;
|
|
||||||
nvidiaSettings = false;
|
|
||||||
package = config.boot.kernelPackages.nvidiaPackages.beta;
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.pathsToLink = ["/libexec"];
|
environment.pathsToLink = ["/libexec"];
|
||||||
|
|
||||||
wyrdgard = {
|
wyrdgard = {
|
||||||
|
@ -40,11 +24,11 @@ with lib.wyrdgard; {
|
||||||
_1password = enabled;
|
_1password = enabled;
|
||||||
};
|
};
|
||||||
|
|
||||||
system.hardware.bluetooth = enabled;
|
system.hardware = {
|
||||||
|
bluetooth = enabled;
|
||||||
|
gpu.nvidia = enabled;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.xserver.videoDrivers = ["nvidia"];
|
|
||||||
services.xserver.displayManager.sddm.wayland.enable = lib.mkForce false;
|
|
||||||
|
|
||||||
system.stateVersion = "23.11";
|
system.stateVersion = "23.11";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue