mirror of
https://github.com/Ascyii/nixos.git
synced 2026-01-01 06:44:26 -05:00
30 lines
592 B
Nix
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;
|
|
};
|
|
};
|
|
}
|