From 37da6d768b52dbff17c3b9d23d26237054fa55c8 Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Wed, 28 Aug 2024 13:01:00 +0530 Subject: cez/specialisation: move to standalone module --- os/cez/modules/specialisation.nix | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 os/cez/modules/specialisation.nix (limited to 'os/cez/modules') diff --git a/os/cez/modules/specialisation.nix b/os/cez/modules/specialisation.nix new file mode 100644 index 0000000..ccee839 --- /dev/null +++ b/os/cez/modules/specialisation.nix @@ -0,0 +1,28 @@ +{ lib, ... }: { + specialisation.nvidia.configuration = { + boot = { + kernelParams = [ "transparent_hugepage=always" ]; + kernel.sysctl."vm.max_map_count" = 2147483642; + }; + + environment.variables = { + DRI_PRIME = 1; + __NV_PRIME_RENDER_OFFLOAD = 1; + __VK_LAYER_NV_optimus = "NVIDIA_only"; + __GLX_VENDOR_LIBRARY_NAME = "nvidia"; + }; + + hardware.nvidia = { + open = true; + nvidiaSettings = false; + prime.sync.enable = true; + }; + + services = { + xserver.videoDrivers = [ "nvidia" ]; + tlp.settings.PLATFORM_PROFILE_ON_AC = lib.mkForce "performance"; + }; + nixpkgs.config.allowUnfreePredicate = + pkg: builtins.elem (lib.getName pkg) [ "nvidia-x11" ]; + }; +} -- cgit v1.2.3