[Hardware/Nvidia] Add nvtop + enhance conf

Remove dead config
Use mkIF instead of ifEnable
This commit is contained in:
Antoine Viallon 2022-06-09 01:11:31 +02:00
parent 98c0ce1bc0
commit 0da55b8288
Signed by: aviallon
GPG key ID: 186FC35EDEB25716

View file

@ -17,18 +17,8 @@ in {
hardware.nvidia = { hardware.nvidia = {
powerManagement.enable = true; powerManagement.enable = true;
powerManagement.finegrained = ifEnable config.hardware.nvidia.prime.offload.enable true; powerManagement.finegrained = mkIf config.hardware.nvidia.prime.offload.enable true;
modesetting.enable = true; modesetting.enable = true;
#package = with config.boot.kernelPackages.nvidiaPackages;
# if (cfg.driver == "stable") then
# stable
# else if (cfg.driver == "390") then
# legacy_390
# else if (cfg.driver == "340") then
# legacy_340
# else
# null
# ;
}; };
aviallon.boot.cmdline = mkIf cfg.saveAllVram { aviallon.boot.cmdline = mkIf cfg.saveAllVram {
@ -39,6 +29,7 @@ in {
aviallon.programs.allowUnfreeList = [ aviallon.programs.allowUnfreeList = [
"nvidia-x11" "nvidia-x11"
"nvidia-settings" "nvidia-settings"
"cudatoolkit"
]; ];
hardware.opengl.extraPackages = with pkgs; [ hardware.opengl.extraPackages = with pkgs; [
@ -51,6 +42,10 @@ in {
vaapiVdpau vaapiVdpau
]; ];
environment.systemPackages = with pkgs; [
nvtop
];
# See documentation here: https://download.nvidia.com/XFree86/Linux-x86_64/510.60.02/README/openglenvvariables.html # See documentation here: https://download.nvidia.com/XFree86/Linux-x86_64/510.60.02/README/openglenvvariables.html
environment.variables = { environment.variables = {
"__GL_YIELD" = "USLEEP"; # use usleep(0) instead of sched_yield() -> better performance in most cases "__GL_YIELD" = "USLEEP"; # use usleep(0) instead of sched_yield() -> better performance in most cases