diff --git a/host/ThinkPad/configuration.nix b/host/ThinkPad/configuration.nix index c7fc08f..c55779b 100644 --- a/host/ThinkPad/configuration.nix +++ b/host/ThinkPad/configuration.nix @@ -8,6 +8,7 @@ ./modules/grab.nix ./modules/swap.nix ./modules/intel.nix + ./modules/grab.nix ./modules/nvidia.nix ./modules/fingerprint.nix @@ -29,6 +30,9 @@ }) ]; + host.laptop = true; + host.nvidia.prime.enable = true; + programs.gamemode.enable = true; hardware.bluetooth.enable = true; services.printing.enable = true; diff --git a/host/modules/common.nix b/host/modules/common.nix index c3a3463..6960276 100644 --- a/host/modules/common.nix +++ b/host/modules/common.nix @@ -6,6 +6,26 @@ ./packages.nix ]; + options = { + host = { + laptop = lib.mkEnableOption "laptop mode"; + + nvidia.prime = { + enable = lib.mkEnableOption "NVIDIA PRIME offload for hybrid graphics"; + intelBusId = lib.mkOption { + type = lib.types.str; + default = "PCI:0:2:0"; + description = "Intel/iGPU Bus ID used by NVIDIA PRIME."; + }; + nvidiaBusId = lib.mkOption { + type = lib.types.str; + default = "PCI:1:0:0"; + description = "NVIDIA dGPU Bus ID used by NVIDIA PRIME."; + }; + }; + }; + }; + config = { networking.hostName = hostname; time.timeZone = lib.mkDefault "Europe/Moscow";