From 4ac71504155c4ac80d2f37bc0401c9b3aa75fadb Mon Sep 17 00:00:00 2001 From: Bradley Nelson Date: Sat, 31 Aug 2024 16:40:11 -0600 Subject: [PATCH] feat: Add configurations for nvidia microarchitectures with configs for the open source drivers --- common/gpu/nvidia/ada-lovelace/default.nix | 10 ++++++++++ common/gpu/nvidia/ampere/default.nix | 10 ++++++++++ common/gpu/nvidia/maxwell/default.nix | 7 +++++++ common/gpu/nvidia/pascal/default.nix | 7 +++++++ common/gpu/nvidia/turing/default.nix | 10 ++++++++++ flake.nix | 5 +++++ 6 files changed, 49 insertions(+) create mode 100644 common/gpu/nvidia/ada-lovelace/default.nix create mode 100644 common/gpu/nvidia/ampere/default.nix create mode 100644 common/gpu/nvidia/maxwell/default.nix create mode 100644 common/gpu/nvidia/pascal/default.nix create mode 100644 common/gpu/nvidia/turing/default.nix diff --git a/common/gpu/nvidia/ada-lovelace/default.nix b/common/gpu/nvidia/ada-lovelace/default.nix new file mode 100644 index 0000000..9a06576 --- /dev/null +++ b/common/gpu/nvidia/ada-lovelace/default.nix @@ -0,0 +1,10 @@ +{lib, config, ...}: +let + nividiaPackage = config.hardware.nvidia.package; +in +{ + imports = [ ../. ]; + + # enable the opensorce drivers if the package supports it + hardware.nvidia.open = lib.mkDefault (nividiaPackage ? open && nividiaPackage ? firmware); +} diff --git a/common/gpu/nvidia/ampere/default.nix b/common/gpu/nvidia/ampere/default.nix new file mode 100644 index 0000000..9a06576 --- /dev/null +++ b/common/gpu/nvidia/ampere/default.nix @@ -0,0 +1,10 @@ +{lib, config, ...}: +let + nividiaPackage = config.hardware.nvidia.package; +in +{ + imports = [ ../. ]; + + # enable the opensorce drivers if the package supports it + hardware.nvidia.open = lib.mkDefault (nividiaPackage ? open && nividiaPackage ? firmware); +} diff --git a/common/gpu/nvidia/maxwell/default.nix b/common/gpu/nvidia/maxwell/default.nix new file mode 100644 index 0000000..8956509 --- /dev/null +++ b/common/gpu/nvidia/maxwell/default.nix @@ -0,0 +1,7 @@ +{lib, ...}: +{ + imports = [ ../. ]; + + # The open source driver does not support Maxwell GPUs. + hardware.nvidia.open = false; +} diff --git a/common/gpu/nvidia/pascal/default.nix b/common/gpu/nvidia/pascal/default.nix new file mode 100644 index 0000000..ad3555d --- /dev/null +++ b/common/gpu/nvidia/pascal/default.nix @@ -0,0 +1,7 @@ +{lib, ...}: +{ + imports = [ ../. ]; + + # The open source driver does not support Pascal GPUs. + hardware.nvidia.open = false; +} diff --git a/common/gpu/nvidia/turing/default.nix b/common/gpu/nvidia/turing/default.nix new file mode 100644 index 0000000..9a06576 --- /dev/null +++ b/common/gpu/nvidia/turing/default.nix @@ -0,0 +1,10 @@ +{lib, config, ...}: +let + nividiaPackage = config.hardware.nvidia.package; +in +{ + imports = [ ../. ]; + + # enable the opensorce drivers if the package supports it + hardware.nvidia.open = lib.mkDefault (nividiaPackage ? open && nividiaPackage ? firmware); +} diff --git a/flake.nix b/flake.nix index 619d4b9..9b8d6ec 100644 --- a/flake.nix +++ b/flake.nix @@ -295,6 +295,11 @@ common-gpu-nvidia-sync = import ./common/gpu/nvidia/prime-sync.nix; common-gpu-nvidia-nonprime = import ./common/gpu/nvidia; common-gpu-nvidia-disable = import ./common/gpu/nvidia/disable.nix; + common-gpu-nvidia-ada-lovelace = import ./common/gpu/nvidia/ada-lovelace; + common-gpu-nvidia-ampere = import ./common/gpu/nvidia/ampere; + common-gpu-nvidia-turing = import ./common/gpu/nvidia/turing; + common-gpu-nvidia-pascal = import ./common/gpu/nvidia/pascal; + common-gpu-nvidia-maxwell = import ./common/gpu/nvidia/maxwell; common-hidpi = import ./common/hidpi.nix; common-pc = import ./common/pc; common-pc-hdd = import ./common/pc/hdd;