laptop: add nvidia-full specialisation

This commit is contained in:
Lgmrszd 2024-05-16 23:41:38 +03:00
parent eb2ec29bb5
commit 2be04cc260
No known key found for this signature in database
GPG key ID: 9396B8BA6FBB14DE

View file

@ -2,7 +2,7 @@
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running `nixos-help`). # and in the NixOS manual (accessible by running `nixos-help`).
{ config, pkgs, pkgs-stable, ... }: { lib, config, pkgs, pkgs-stable, ... }:
let let
nixPath = "/etc/nixPath"; nixPath = "/etc/nixPath";
@ -154,11 +154,28 @@ in
enable = true; enable = true;
enableOffloadCmd = true; enableOffloadCmd = true;
}; };
sync.enable = false;
intelBusId = "PCI:0:2:0"; intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0"; nvidiaBusId = "PCI:1:0:0";
}; };
specialisation."nvidia-full".configuration = {
environment.etc."specialisation".text = "nvidia-full";
system.nixos.tags = ["nvidia-full"];
hardware.nvidia.prime = {
offload.enable = lib.mkForce false;
offload.enableOffloadCmd = lib.mkForce false;
sync.enable = lib.mkForce true;
};
environment.systemPackages = [
(pkgs.writeShellScriptBin "nvidia-offload" ''
echo "nvidia full mode on, simply executing $@"
exec "$@"
'')
];
};
programs.gamemode.enable = true; programs.gamemode.enable = true;
# VirtualBox # VirtualBox