Files
nixos/modules/hardware/nvidia.nix
2025-10-14 11:09:14 +02:00

30 lines
592 B
Nix

{ config, lib, pkgs, ... }:
let inherit (lib) mkOption types;
in {
options = {
enableCuda = mkOption {
type = types.bool;
default = false;
};
nvidiaOpen = mkOption {
type = types.bool;
default = false;
};
};
config = {
hardware.graphics.enable = true;
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
modesetting.enable = true;
powerManagement.enable = false;
open = config.nvidiaOpen;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
};
}