From df307e75255bffab66bd5d298f36a8e9fde78ae2 Mon Sep 17 00:00:00 2001 From: nyxerinys Date: Thu, 8 Oct 2026 20:36:25 -0500 Subject: [PATCH] add nvidia to dionysus --- hosts/servers/dionysus/default.nix | 1 + hosts/servers/dionysus/nvidia.nix | 59 ++++++++++++++++++++++++++ hosts/servers/poseidon/old/default.nix | 2 - hosts/servers/poseidon/old/nvidia.nix | 2 + 4 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 hosts/servers/dionysus/nvidia.nix diff --git a/hosts/servers/dionysus/default.nix b/hosts/servers/dionysus/default.nix index ad4cee0..9d9eefd 100644 --- a/hosts/servers/dionysus/default.nix +++ b/hosts/servers/dionysus/default.nix @@ -3,6 +3,7 @@ { imports = [ ./hardware.nix + ./nvidia.nix ]; boot.loader = { diff --git a/hosts/servers/dionysus/nvidia.nix b/hosts/servers/dionysus/nvidia.nix new file mode 100644 index 0000000..a9d6b45 --- /dev/null +++ b/hosts/servers/dionysus/nvidia.nix @@ -0,0 +1,59 @@ +{lib, config, ...}: + +{ + services.xserver.videoDrivers = ["nvidia"]; + + boot.blacklistedKernelModules = ["nouveau"]; + + hardware = { + graphics = { + enable = true; + }; + + nvidia-container-toolkit.enable = true; + + nvidia = { + # Modesetting is required. + modesetting.enable = true; + + # Nvidia power management. Experimental, and can cause sleep/suspend to fail. + # Enable this if you have graphical corruption issues or application crashes after waking + # up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead + # of just the bare essentials. + powerManagement.enable = false; + + # Fine-grained power management. Turns off GPU when not in use. + # Experimental and only works on modern Nvidia GPUs (Turing or newer). + powerManagement.finegrained = false; + + # Use the NVidia open source kernel module (not to be confused with the + # independent third-party "nouveau" open source driver). + # Support is limited to the Turing and later architectures. Full list of + # supported GPUs is at: + # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus + # Only available from driver 515.43.04+ + open = true; + + # Enable the Nvidia settings menu, + # accessible via `nvidia-settings`. + nvidiaSettings = true; + + # Optionally, you may need to select the appropriate driver version for your specific GPU. + package = config.boot.kernelPackages.nvidiaPackages.stable; + # package = config.boot.kernelPackages.nvidiaPackages.mkDriver { + # version = "580.105.08"; + + # # Update these hashes to whatever nix tells you to, + # # and set them back to `lib.fakeHash` every time you + # # change the version. + # sha256_64bit = "sha256-2cboGIZy8+t03QTPpp3VhHn6HQFiyMKMjRdiV2MpNHU="; + # openSha256 = "sha256-FGmMt3ShQrw4q6wsk8DSvm96ie5yELoDFYinSlGZcwQ="; + # settingsSha256 = "sha256-YvzWO1U3am4Nt5cQ+b5IJ23yeWx5ud1HCu1U0KoojLY="; + + # # You can leave these unspecified + # sha256_aarch64 = lib.fakeHash; + # persistencedSha256 = lib.fakeHash; + # }; + }; + }; +} \ No newline at end of file diff --git a/hosts/servers/poseidon/old/default.nix b/hosts/servers/poseidon/old/default.nix index 951752e..186f450 100644 --- a/hosts/servers/poseidon/old/default.nix +++ b/hosts/servers/poseidon/old/default.nix @@ -26,8 +26,6 @@ }; }; - boot.blacklistedKernelModules = ["nouveau"]; - fileSystems."/" = { device = "nixroot/root"; fsType = "zfs"; diff --git a/hosts/servers/poseidon/old/nvidia.nix b/hosts/servers/poseidon/old/nvidia.nix index 42e6fc6..e11abec 100644 --- a/hosts/servers/poseidon/old/nvidia.nix +++ b/hosts/servers/poseidon/old/nvidia.nix @@ -3,6 +3,8 @@ { services.xserver.videoDrivers = ["nvidia"]; + boot.blacklistedKernelModules = ["nouveau"]; + hardware = { graphics = { enable = true;