diff options
| author | seth <[email protected]> | 2023-05-08 00:21:41 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2023-05-08 00:21:41 -0400 |
| commit | 9cedd06b8589a5d39a7a85e2efe646a8edebac53 (patch) | |
| tree | 8884a1238b0586396bc403098e23e78505ab514e /modules/nixos/hardware | |
| parent | 589c80eb1bcaf76b4a1a7e6f9cdd725fdb04e063 (diff) | |
modules: merge base and nixos
Diffstat (limited to 'modules/nixos/hardware')
| -rw-r--r-- | modules/nixos/hardware/default.nix | 18 | ||||
| -rw-r--r-- | modules/nixos/hardware/nvidia.nix | 33 |
2 files changed, 51 insertions, 0 deletions
diff --git a/modules/nixos/hardware/default.nix b/modules/nixos/hardware/default.nix new file mode 100644 index 0000000..cefa15c --- /dev/null +++ b/modules/nixos/hardware/default.nix @@ -0,0 +1,18 @@ +{ + config, + lib, + ... +}: let + cfg = config.getchoo.hardware; + inherit (lib) mkEnableOption mkIf; +in { + options.getchoo.hardware.enable = mkEnableOption "hardware module"; + + imports = [ + ./nvidia.nix + ]; + + config = mkIf cfg.enable { + hardware.enableAllFirmware = true; + }; +} diff --git a/modules/nixos/hardware/nvidia.nix b/modules/nixos/hardware/nvidia.nix new file mode 100644 index 0000000..c317226 --- /dev/null +++ b/modules/nixos/hardware/nvidia.nix @@ -0,0 +1,33 @@ +{ + config, + lib, + pkgs, + ... +}: let + cfg = config.getchoo.hardware.nvidia; + inherit (lib) mkEnableOption mkIf; +in { + options.getchoo.hardware.nvidia.enable = mkEnableOption "enable nvidia support"; + + config = mkIf cfg.enable { + getchoo.hardware.enable = true; + + hardware = { + nvidia = { + package = config.boot.kernelPackages.nvidiaPackages.stable; + modesetting.enable = true; + }; + + opengl = { + enable = true; + # make steam work + driSupport32Bit = true; + extraPackages = with pkgs; [ + vaapiVdpau + ]; + }; + }; + + services.xserver.videoDrivers = ["nvidia"]; + }; +} |
