summary refs log tree commit diff
path: root/modules/hardware/nvidia-gpu.nix
diff options
context:
space:
mode:
authorMel <mel@rnrd.eu>2026-01-06 18:41:15 +0100
committerMel <mel@rnrd.eu>2026-01-06 18:41:15 +0100
commitee5f89c69f60fbe2821b9fdf780146fbec73725c (patch)
treef8079c0b1b972ddaed92937d89a3b95f65c8698d /modules/hardware/nvidia-gpu.nix
parent1c0969c93bbc18d4327bc213fa82df659e6bd61c (diff)
downloadminerals-ee5f89c69f60fbe2821b9fdf780146fbec73725c.tar.zst
minerals-ee5f89c69f60fbe2821b9fdf780146fbec73725c.zip
Switch Bismuth from Nvidia to AMD, move hardware modules to own directory
Signed-off-by: Mel <mel@rnrd.eu>
Diffstat (limited to 'modules/hardware/nvidia-gpu.nix')
-rw-r--r--modules/hardware/nvidia-gpu.nix49
1 files changed, 49 insertions, 0 deletions
diff --git a/modules/hardware/nvidia-gpu.nix b/modules/hardware/nvidia-gpu.nix
new file mode 100644
index 0000000..dae9fb5
--- /dev/null
+++ b/modules/hardware/nvidia-gpu.nix
@@ -0,0 +1,49 @@
+{
+  config,
+  lib,
+  pkgs,
+  ...
+}:
+
+let
+  gpl_symbols_linux_615_patch = pkgs.fetchpatch {
+    url = "https://github.com/CachyOS/kernel-patches/raw/914aea4298e3744beddad09f3d2773d71839b182/6.15/misc/nvidia/0003-Workaround-nv_vm_flags_-calling-GPL-only-code.patch";
+    hash = "sha256-YOTAvONchPPSVDP9eJ9236pAPtxYK5nAePNtm2dlvb4=";
+    stripLen = 1;
+    extraPrefix = "kernel/";
+  };
+in
+{
+  hardware.graphics = {
+    enable = true;
+    enable32Bit = true;
+  };
+
+  services.xserver.videoDrivers = [ "nvidia" ];
+
+  hardware.nvidia = {
+    modesetting.enable = true;
+    powerManagement.enable = true;
+    powerManagement.finegrained = false;
+
+    # note: fails to build after 560
+    nvidiaSettings = false;
+
+    # sadly still very crashy :(
+    open = false;
+
+    # nice way:
+    # package = config.boot.kernelPackages.nvidiaPackages.beta;
+    # manual way:
+    package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
+      version = "575.57.08";
+      sha256_64bit = "sha256-KqcB2sGAp7IKbleMzNkB3tjUTlfWBYDwj50o3R//xvI=";
+      sha256_aarch64 = "sha256-VJ5z5PdAL2YnXuZltuOirl179XKWt0O4JNcT8gUgO98=";
+      openSha256 = "sha256-DOJw73sjhQoy+5R0GHGnUddE6xaXb/z/Ihq3BKBf+lg=";
+      settingsSha256 = "sha256-AIeeDXFEo9VEKCgXnY3QvrW5iWZeIVg4LBCeRtMs5Io=";
+      persistencedSha256 = "sha256-Len7Va4HYp5r3wMpAhL4VsPu5S0JOshPFywbO7vYnGo=";
+
+      patches = [ gpl_symbols_linux_615_patch ];
+    };
+  };
+}