Nix-Vibe public snapshot (squashed history)
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
cfg = config.my.hardware.nvidia;
|
||||
in
|
||||
{
|
||||
options.my.hardware.nvidia = {
|
||||
enable = lib.mkEnableOption "NVIDIA proprietary driver configuration";
|
||||
|
||||
package = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.package;
|
||||
default = null;
|
||||
description = "NVIDIA driver package, or null to use the kernel's default.";
|
||||
};
|
||||
|
||||
nvidiaSettings = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Whether to enable the nvidia-settings GUI tool.";
|
||||
};
|
||||
|
||||
powerManagement = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Whether to enable NVIDIA power management (persistence mode).";
|
||||
};
|
||||
|
||||
enable32Bit = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Whether to enable 32-bit OpenGL/Vulkan libraries.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
hardware.graphics = {
|
||||
enable = true;
|
||||
enable32Bit = cfg.enable32Bit;
|
||||
};
|
||||
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = true;
|
||||
open = false; # Proprietary driver (pre-Turing/legacy architectures)
|
||||
nvidiaSettings = cfg.nvidiaSettings;
|
||||
powerManagement.enable = cfg.powerManagement;
|
||||
package = lib.mkIf (cfg.package != null) cfg.package;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user