mirror of
https://git.lgmrszd.xyz/Lgmrszd/nix-cfg.git
synced 2024-11-22 03:07:56 +01:00
laptop: add nvidia-full specialisation
This commit is contained in:
parent
eb2ec29bb5
commit
2be04cc260
1 changed files with 18 additions and 1 deletions
|
@ -2,7 +2,7 @@
|
|||
# your system. Help is available in the configuration.nix(5) man page
|
||||
# and in the NixOS manual (accessible by running `nixos-help`).
|
||||
|
||||
{ config, pkgs, pkgs-stable, ... }:
|
||||
{ lib, config, pkgs, pkgs-stable, ... }:
|
||||
|
||||
let
|
||||
nixPath = "/etc/nixPath";
|
||||
|
@ -154,11 +154,28 @@ in
|
|||
enable = true;
|
||||
enableOffloadCmd = true;
|
||||
};
|
||||
sync.enable = false;
|
||||
|
||||
intelBusId = "PCI:0:2: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;
|
||||
|
||||
# VirtualBox
|
||||
|
|
Loading…
Reference in a new issue