backward compat

This commit is contained in:
Peder Bergebakken Sundt 2024-10-24 23:51:49 +02:00
parent 86f1fcdeb6
commit ae375933f3
1 changed files with 15 additions and 0 deletions

View File

@ -1,4 +1,5 @@
{ config, pkgs, lib, ... }:
lib.mkMerge [
{
# assumes common-gpu-nvidia from nixos-hardware is also added
# TODO: should we move it from flake.nix to here?
@ -6,8 +7,15 @@
# https://github.com/NixOS/nixos-hardware/blob/master/common/gpu/nvidia/prime.nix
hardware.opengl.enable = true;
}
(lib.mkIf (lib.versionOlder (lib.versions.majorMinor lib.version) "24.11") {
hardware.opengl.driSupport = true;
hardware.opengl.driSupport32Bit = true;
})
(lib.mkIf (lib.versionAtLeast (lib.versions.majorMinor lib.version) "24.11") {
hardware.nvidia.open = true;
})
{
nixpkgs.config.openglSupport = true; # why is this not set by hardware.opengl.enable ?
nixpkgs.config.cudaSupport = true;
@ -22,8 +30,14 @@
(lib.hasInfix "cublas" (lib.toLower (lib.getName pkg)))
];
}
(
/* lib.mkIf (lib.versionAtLeast (lib.versions.majorMinor lib.version) "24.11") { */
(lib.optionalAttrs (lib.versionAtLeast (lib.versions.majorMinor lib.version) "24.11") {
programs.nix-required-mounts.enable = true;
programs.nix-required-mounts.presets.nvidia-gpu.enable = true;
})
{
# https://nixos.wiki/wiki/Nvidia
@ -121,3 +135,4 @@
/**/
};
}
]