2025-04-08 20:11:16 +02:00
{
lib ,
pkgs ,
config ,
. . .
} :
2025-03-24 09:24:30 +01:00
with lib ;
let
cfg = config . liv . nvidia ;
2025-04-08 20:11:16 +02:00
in
{
2025-03-24 09:24:30 +01:00
options . liv . nvidia = {
enable = mkEnableOption " E n a b l e N V I D I A d r i v e r s " ;
} ;
config = mkIf cfg . enable {
2025-10-26 01:10:18 +02:00
services . xserver . videoDrivers = [ " n v i d i a " ] ;
2025-03-24 09:24:30 +01:00
hardware = {
2025-10-26 01:10:18 +02:00
nvidia = {
modesetting . enable = true ;
powerManagement . enable = false ;
powerManagement . finegrained = false ;
open = false ;
nvidiaSettings = true ;
package = config . boot . kernelPackages . nvidiaPackages . stable ;
} ;
2025-04-08 20:11:16 +02:00
enableRedistributableFirmware = true ;
2025-03-24 09:24:30 +01:00
graphics = {
enable = true ;
extraPackages = with pkgs ; [
2025-04-24 16:40:11 +02:00
# 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.
2025-03-24 09:24:30 +01:00
] ;
# For 32 bit applications as well
extraPackages32 = with pkgs ; [
2025-04-24 16:40:11 +02:00
# 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.
2025-03-24 09:24:30 +01:00
] ;
} ;
} ;
environment . systemPackages = with pkgs ; [
# amdvlk
2025-10-26 01:10:18 +02:00
#nvidia-x11
#nvidia-settings
#nvidia-persistenced
nvtopPackages . nvidia
2025-03-24 09:24:30 +01:00
] ;
} ;
}