From 2be04cc260a98f96895e79a68fd713b285e7f0be Mon Sep 17 00:00:00 2001 From: Lgmrszd Date: Thu, 16 May 2024 23:41:38 +0300 Subject: [PATCH] laptop: add nvidia-full specialisation --- hosts/laptop/configuration.nix | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) 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