From 871d3903f7483f79ec4df19566c28d64f06fd411 Mon Sep 17 00:00:00 2001 From: Shahab Dogar Date: Fri, 15 Aug 2025 18:17:59 +0500 Subject: [PATCH] feat: introduce specialisations into nix config --- hosts/common/optional/gaming.nix | 16 ---------------- hosts/common/specialisations/gaming.nix | 20 ++++++++++++++++++++ hosts/common/specialisations/powersave.nix | 7 +++++++ hosts/nixos/rihla/default.nix | 10 +++++++++- 4 files changed, 36 insertions(+), 17 deletions(-) delete mode 100644 hosts/common/optional/gaming.nix create mode 100644 hosts/common/specialisations/gaming.nix create mode 100644 hosts/common/specialisations/powersave.nix diff --git a/hosts/common/optional/gaming.nix b/hosts/common/optional/gaming.nix deleted file mode 100644 index 4581c53..0000000 --- a/hosts/common/optional/gaming.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ pkgs, ... }: - -{ - programs = { - steam = { - enable = true; - gamescopeSession.enable = true; - }; - - # to run steam games in game mode, add the following to the game's properties from within steam - # gamemoderun %command% - gamemode.enable = true; - }; - - environment.systemPackages = with pkgs; [ mangohud protonup-qt ]; -} diff --git a/hosts/common/specialisations/gaming.nix b/hosts/common/specialisations/gaming.nix new file mode 100644 index 0000000..53b5870 --- /dev/null +++ b/hosts/common/specialisations/gaming.nix @@ -0,0 +1,20 @@ +{ pkgs, ... }: + +{ + specialisation.gaming.configuration = { + programs = { + steam = { + enable = true; + gamescopeSession.enable = true; + }; + + # to run steam games in game mode, add the following to the game's properties from within steam + # gamemoderun %command% + gamemode.enable = true; + }; + + powerManagement.cpuFreqGovernor = "performance"; + + environment.systemPackages = with pkgs; [ mangohud protonup-qt ]; + }; +} diff --git a/hosts/common/specialisations/powersave.nix b/hosts/common/specialisations/powersave.nix new file mode 100644 index 0000000..bbbf826 --- /dev/null +++ b/hosts/common/specialisations/powersave.nix @@ -0,0 +1,7 @@ +{ ... }: + +{ + specialisation.powersave.configuration = { + powerManagement.cpuFreqGovernor = "powersave"; + }; +} diff --git a/hosts/nixos/rihla/default.nix b/hosts/nixos/rihla/default.nix index 7291a32..19c4afb 100644 --- a/hosts/nixos/rihla/default.nix +++ b/hosts/nixos/rihla/default.nix @@ -42,7 +42,6 @@ "1password" "dconf" "docker" - "gaming" "hyprland" "nix-ld" "secure-boot" @@ -63,6 +62,15 @@ "printing" "smart-card" ]) + + # + # ========= Specialisations ======== + # + (map + (s: lib.custom.relativeToRoot "hosts/common/specialisations/${s}.nix") [ + "gaming" + "powersave" + ]) ]; #