From c0211a8b769030a666f4fa70ecb9aec4bc94a6ba Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 8 May 2024 16:16:42 +0200 Subject: [PATCH] Allow added unfree software --- lib/configuration.nix | 1 + lib/modules/unfree.nix | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 lib/modules/unfree.nix diff --git a/lib/configuration.nix b/lib/configuration.nix index 1138829..2ee9489 100644 --- a/lib/configuration.nix +++ b/lib/configuration.nix @@ -4,6 +4,7 @@ ./modules/custom-sops-nix.nix ./modules/my-users.nix ./modules/sddm.nix + ./modules/unfree.nix ]; config = { diff --git a/lib/modules/unfree.nix b/lib/modules/unfree.nix new file mode 100644 index 0000000..c65ba7c --- /dev/null +++ b/lib/modules/unfree.nix @@ -0,0 +1,37 @@ +{ lib, machineConfig, ... }: { + config = { + nixpkgs = { + config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) ( + let + names = + (lib.optional machineConfig.xone "xow_dongle-firmware") ++ + (lib.optionals machineConfig.nvidia [ + "cuda_cccl" + "cuda_cudart" + "cuda_cuobjdump" + "cuda_cupti" + "cuda_cuxxfilt" + "cuda_gdb" + "cuda-merged" + "cuda_nvcc" + "cuda_nvdisasm" + "cuda_nvml_dev" + "cuda_nvprune" + "cuda_nvrtc" + "cuda_nvtx" + "cuda_profiler_api" + "cuda_sanitizer_api" + "libcublas" + "libcufft" + "libcurand" + "libcusolver" + "libcusparse" + "libnpp" + "libnvjitlink" + "rar" + ]); + in + names); + }; + }; +}