From 98f47d6c6ab43abf698394dc8ab5384f78025452 Mon Sep 17 00:00:00 2001 From: Corwin Perren Date: Wed, 25 Jun 2025 05:27:46 -0700 Subject: [PATCH] Deduplicate steam --- hosts/cap-nr200p/configuration.nix | 14 +------------- hosts/cap-slim7/configuration.nix | 8 +------- modules/application-groups/gaming.nix | 5 +++++ modules/applications/steam.nix | 17 +++++++++++++++++ 4 files changed, 24 insertions(+), 20 deletions(-) create mode 100644 modules/application-groups/gaming.nix create mode 100644 modules/applications/steam.nix diff --git a/hosts/cap-nr200p/configuration.nix b/hosts/cap-nr200p/configuration.nix index 5af509f..fca8fab 100644 --- a/hosts/cap-nr200p/configuration.nix +++ b/hosts/cap-nr200p/configuration.nix @@ -13,6 +13,7 @@ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix + ../../modules/application-groups/gaming.nix ]; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; @@ -308,7 +309,6 @@ }; virtualisation.waydroid.enable = true; - hardware.steam-hardware.enable = true; virtualisation.podman = { enable = true; @@ -387,18 +387,6 @@ ]; }; - programs.steam = { - enable = true; - remotePlay.openFirewall = true; - dedicatedServer.openFirewall = true; - gamescopeSession.enable = true; - }; - - programs.gamescope = { - enable = true; - capSysNice = true; - }; - # Some programs need SUID wrappers, can be configured further or are # started in user sessions. # programs.mtr.enable = true; diff --git a/hosts/cap-slim7/configuration.nix b/hosts/cap-slim7/configuration.nix index c5ee952..f8dc85f 100644 --- a/hosts/cap-slim7/configuration.nix +++ b/hosts/cap-slim7/configuration.nix @@ -8,6 +8,7 @@ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix + ../../modules/application-groups/gaming.nix ]; #boot.kernelPackages = pkgs.linuxPackages_latest; @@ -393,13 +394,6 @@ ]; }; - programs.steam = { - enable = true; - remotePlay.openFirewall = true; - dedicatedServer.openFirewall = true; - gamescopeSession.enable = true; - }; - # Some programs need SUID wrappers, can be configured further or are # started in user sessions. # programs.mtr.enable = true; diff --git a/modules/application-groups/gaming.nix b/modules/application-groups/gaming.nix new file mode 100644 index 0000000..d87e3f8 --- /dev/null +++ b/modules/application-groups/gaming.nix @@ -0,0 +1,5 @@ +{ ... }: { + imports = [ + ../applications/steam.nix + ]; +} \ No newline at end of file diff --git a/modules/applications/steam.nix b/modules/applications/steam.nix new file mode 100644 index 0000000..0063f9a --- /dev/null +++ b/modules/applications/steam.nix @@ -0,0 +1,17 @@ +{ config, pkgs, ... }: +{ + hardware.steam-hardware.enable = true; + + programs.steam = { + enable = true; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + gamescopeSession.enable = true; + }; + + programs.gamescope = { + enable = true; + capSysNice = true; + }; + +}