1
0
Fork 0
mirror of https://github.com/NixOS/nixos-hardware synced 2024-12-28 20:49:45 +01:00
nixos-hardware/common/gpu/nvidia/ada-lovelace/default.nix

29 lines
855 B
Nix
Raw Normal View History

{lib, config, ...}:
let
2024-10-31 09:55:20 +01:00
nvidiaPackage = config.hardware.nvidia.package;
in
{
imports = [ ../. ];
2024-09-01 20:09:28 +02:00
# enable the open source drivers if the package supports it
2024-10-31 09:55:20 +01:00
hardware.nvidia.open = lib.mkOverride 990 (nvidiaPackage ? open && nvidiaPackage ? firmware);
# nvidia's hibernate, suspend, and resume services are not normally triggered on suspend-then-hibernate and hybrid-hibernate
systemd.services = {
nvidia-hibernate = {
before = [ "systemd-suspend-then-hibernate.service" ];
wantedBy = [ "suspend-then-hibernate.target" ];
};
nvidia-suspend = {
before = [ "systemd-hybrid-sleep.service" ];
wantedBy = [ "hybrid-sleep.target" ];
};
nvidia-resume = {
after = [ "systemd-suspend-then-hibernate.service" "systemd-hybrid-sleep.service" ];
wantedBy = [ "post-resume.target" ];
};
};
}