mirror of
https://github.com/Ahwxorg/nixos-config.git
synced 2025-12-04 06:50:14 +01:00
48 lines
1.3 KiB
Nix
48 lines
1.3 KiB
Nix
{
|
|
lib,
|
|
pkgs,
|
|
config,
|
|
...
|
|
}:
|
|
with lib;
|
|
let
|
|
cfg = config.liv.nvidia;
|
|
in
|
|
{
|
|
options.liv.nvidia = {
|
|
enable = mkEnableOption "Enable NVIDIA drivers";
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
services.xserver.videoDrivers = [ "nvidia" ];
|
|
hardware = {
|
|
nvidia = {
|
|
modesetting.enable = true;
|
|
powerManagement.enable = false;
|
|
powerManagement.finegrained = false;
|
|
open = if (config.liv.gui.enable == true) then true else false;
|
|
nvidiaSettings = true;
|
|
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
|
};
|
|
enableRedistributableFirmware = true;
|
|
graphics = {
|
|
enable = true;
|
|
extraPackages = with pkgs; [
|
|
# amdvlk would be the package that would be required for AMD on desktop, since none of the hosts use NVIDIA as a desktop GPU, this is open and uncertain.
|
|
];
|
|
# For 32 bit applications as well
|
|
extraPackages32 = with pkgs; [
|
|
# driversi686Linux.amdvlk would be the package that would be required for AMD on desktop, since none of the hosts use NVIDIA as a desktop GPU, this is open and uncertain.
|
|
];
|
|
};
|
|
};
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
# amdvlk
|
|
#nvidia-x11
|
|
#nvidia-settings
|
|
#nvidia-persistenced
|
|
nvtopPackages.nvidia
|
|
];
|
|
};
|
|
}
|