From 3dc8bee3cb3a472dcf8d3990a6623327ac75d985 Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Fri, 5 Dec 2025 09:38:13 +0530 Subject: feat(cez/specialisation/heater): init --- os/cez/modules/specialisation/default.nix | 6 ++++++ os/cez/modules/specialisation/heater.nix | 31 +++++++++++++++++++++++++++++++ os/cez/modules/specialisation/nvidia.nix | 25 +++++++++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 os/cez/modules/specialisation/default.nix create mode 100644 os/cez/modules/specialisation/heater.nix create mode 100644 os/cez/modules/specialisation/nvidia.nix (limited to 'os/cez/modules') diff --git a/os/cez/modules/specialisation/default.nix b/os/cez/modules/specialisation/default.nix new file mode 100644 index 0000000..c7fb4aa --- /dev/null +++ b/os/cez/modules/specialisation/default.nix @@ -0,0 +1,6 @@ +{ + specialisation = { + nvidia.configuration.imports = [ ./nvidia.nix ]; + heater.configuration.imports = [ ./heater.nix ]; + }; +} diff --git a/os/cez/modules/specialisation/heater.nix b/os/cez/modules/specialisation/heater.nix new file mode 100644 index 0000000..68dbf4d --- /dev/null +++ b/os/cez/modules/specialisation/heater.nix @@ -0,0 +1,31 @@ +{ + config, + pkgs, + lib, + ... +}: +let + heater = pkgs.writeShellApplication { + name = "heater"; + runtimeInputs = with pkgs; [ + vulkan-tools + mangohud + ]; + + text = '' + MESA_VK_WSI_PRESENT_MODE=immediate mangohud vkcube --present_mode 0 + ''; + }; + username = config.global.userdata.name; +in +{ + imports = [ ./nvidia.nix ]; + + services.logind.settings.Login.HandleLidSwitch = "ignore"; + environment.systemPackages = [ heater ]; + home-manager.users.${username}.imports = [ + { + wayland.windowManager.sway.settings.exec = [ "${lib.getExe heater}" ]; + } + ]; +} diff --git a/os/cez/modules/specialisation/nvidia.nix b/os/cez/modules/specialisation/nvidia.nix new file mode 100644 index 0000000..3ac30b4 --- /dev/null +++ b/os/cez/modules/specialisation/nvidia.nix @@ -0,0 +1,25 @@ +{ lib, ... }: +{ + 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"; + }; +} -- cgit v1.2.3