diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix index 5c1c0b4..bbc3e4c 100644 --- a/hosts/laptop/configuration.nix +++ b/hosts/laptop/configuration.nix @@ -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