mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-05 17:27:50 +00:00
[Programs/Nvtop] refactor to intelligently enable the required backends
This commit is contained in:
parent
5fa9147e02
commit
d9ea216ea8
5 changed files with 23 additions and 9 deletions
|
|
@ -27,7 +27,10 @@ in {
|
|||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
aviallon.programs.nvtop.enable = true;
|
||||
aviallon.programs.nvtop = {
|
||||
enable = true;
|
||||
backend = [ "amd" ];
|
||||
};
|
||||
|
||||
hardware.opengl = {
|
||||
enable = true;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,10 @@ in
|
|||
];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
aviallon.programs.nvtop.enable = true;
|
||||
aviallon.programs.nvtop = {
|
||||
enable = true;
|
||||
backend = [ "intel" ];
|
||||
};
|
||||
|
||||
boot.initrd.kernelModules = [ "i915" ];
|
||||
hardware.opengl = {
|
||||
|
|
|
|||
|
|
@ -27,7 +27,9 @@ in {
|
|||
config = mkIf cfg.enable {
|
||||
hardware.opengl.driSupport32Bit = true;
|
||||
|
||||
aviallon.programs.nvtop.enable = true;
|
||||
aviallon.programs.nvtop = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
aviallon.hardware.nvidia.useProprietary = mkForce ( cfg.variant == "proprietary" );
|
||||
};
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ in {
|
|||
versionOlder hardwareCfg.nvidia.package.version "490.29.05" # https://www.nvidia.com/download/driverResults.aspx/181159/en-us/
|
||||
);
|
||||
|
||||
aviallon.programs.nvtop.nvidia = true;
|
||||
aviallon.programs.nvtop.backend = [ "nvidia" ];
|
||||
|
||||
boot.extraModprobeConfig = ''
|
||||
options nvidia NVreg_RegistryDwords="${concatStringsSep ";" cfg.proprietary.registryDwords}"
|
||||
|
|
@ -152,10 +152,6 @@ in {
|
|||
nvidia-vaapi-driver
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
nvtop
|
||||
];
|
||||
|
||||
# See documentation here: https://download.nvidia.com/XFree86/Linux-x86_64/510.60.02/README/openglenvvariables.html
|
||||
environment.variables = {
|
||||
"__GL_YIELD" = "USLEEP"; # use usleep(0) instead of sched_yield() -> better performance in most cases
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue