diff options
| author | seth <[email protected]> | 2023-08-25 09:35:01 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2023-08-25 09:48:55 -0400 |
| commit | f3bd2bce23bc80ef129fe9c29e9a8ec93470da13 (patch) | |
| tree | 48538ab29b78b9792f86582b86e4441e4f86f4da /modules | |
| parent | 99ff40ac3b487489830893c23cb09bd97a8031ed (diff) | |
modules/hardware: complete nvidia + add ssd module
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/nixos/hardware/default.nix | 1 | ||||
| -rw-r--r-- | modules/nixos/hardware/nvidia.nix | 11 | ||||
| -rw-r--r-- | modules/nixos/hardware/ssd.nix | 15 |
3 files changed, 26 insertions, 1 deletions
diff --git a/modules/nixos/hardware/default.nix b/modules/nixos/hardware/default.nix index 624ccc1..1217b5a 100644 --- a/modules/nixos/hardware/default.nix +++ b/modules/nixos/hardware/default.nix @@ -9,6 +9,7 @@ in { options.hardware.enable = mkEnableOption "hardware module"; imports = [ + ./ssd.nix ./nvidia.nix ]; diff --git a/modules/nixos/hardware/nvidia.nix b/modules/nixos/hardware/nvidia.nix index 1a0b5f2..dd371f2 100644 --- a/modules/nixos/hardware/nvidia.nix +++ b/modules/nixos/hardware/nvidia.nix @@ -1,6 +1,7 @@ { config, lib, + pkgs, ... }: let cfg = config.hardware.nvidia; @@ -9,9 +10,14 @@ in { options.hardware.nvidia.enable = mkEnableOption "enable nvidia support"; config = mkIf cfg.enable { - hardware.enable = true; + environment.sessionVariables = { + LIBVA_DRIVER_NAME = "vdpau"; + VDPAU_DRIVER = "nvidia"; + }; hardware = { + enable = true; + nvidia = { package = config.boot.kernelPackages.nvidiaPackages.stable; modesetting.enable = true; @@ -21,7 +27,10 @@ in { enable = true; # make steam work driSupport32Bit = true; + extraPackages = [pkgs.vaapiVdpau]; }; }; + + services.xserver.videoDrivers = ["nvidia"]; }; } diff --git a/modules/nixos/hardware/ssd.nix b/modules/nixos/hardware/ssd.nix new file mode 100644 index 0000000..2995d93 --- /dev/null +++ b/modules/nixos/hardware/ssd.nix @@ -0,0 +1,15 @@ +{ + config, + lib, + ... +}: let + cfg = config.hardware.ssd; + inherit (lib) mkEnableOption mkIf; +in { + options.hardware.ssd.enable = mkEnableOption "ssd settings"; + + config = mkIf cfg.enable { + hardware.enable = true; + services.fstrim.enable = true; + }; +} |
