From cbda46edd58ae746ed996dbc5a5c608a42726bda Mon Sep 17 00:00:00 2001 From: Fabian Montero Date: Mon, 27 Jan 2025 19:52:25 -0600 Subject: [PATCH] modularize steam --- home/modules/default.nix | 2 +- .../{gaming/default.nix => gaming.nix} | 5 --- home/modules/gaming/package.nix | 9 ------ sys/modules/default.nix | 1 + sys/modules/steam.nix | 31 +++++++++++++++++++ sys/platforms/posixlycorrect/default.nix | 1 + 6 files changed, 34 insertions(+), 15 deletions(-) rename home/modules/{gaming/default.nix => gaming.nix} (64%) delete mode 100644 home/modules/gaming/package.nix create mode 100644 sys/modules/steam.nix diff --git a/home/modules/default.nix b/home/modules/default.nix index 31109a9..fb90319 100644 --- a/home/modules/default.nix +++ b/home/modules/default.nix @@ -8,7 +8,7 @@ ./terminal ./neovim.nix ./baseline.nix - ./gaming + ./gaming.nix ./yubikey.nix ./browsers.nix ./gui diff --git a/home/modules/gaming/default.nix b/home/modules/gaming.nix similarity index 64% rename from home/modules/gaming/default.nix rename to home/modules/gaming.nix index 5be0efd..5048854 100644 --- a/home/modules/gaming/default.nix +++ b/home/modules/gaming.nix @@ -12,11 +12,6 @@ in { }; config = mkIf cfg.enable { home.packages = [ - # Steam. todo: move to the steam module later - (pkgs.callPackage ./package.nix {}) - pkgs.protonup - pkgs.winetricks - pkgs.protontricks pkgs.lutris pkgs.openrct2 pkgs.prismlauncher diff --git a/home/modules/gaming/package.nix b/home/modules/gaming/package.nix deleted file mode 100644 index 19f241f..0000000 --- a/home/modules/gaming/package.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - writeShellScriptBin, - steam-run, - steam, - ... -}: -writeShellScriptBin "steam" '' - exec ${steam-run}/bin/steam-run ${steam}/bin/steam -console -'' diff --git a/sys/modules/default.nix b/sys/modules/default.nix index 2cdd9a2..27d719e 100644 --- a/sys/modules/default.nix +++ b/sys/modules/default.nix @@ -14,5 +14,6 @@ ./users.nix ./bluetooth.nix ./net.nix + ./steam.nix ]; } diff --git a/sys/modules/steam.nix b/sys/modules/steam.nix new file mode 100644 index 0000000..a6cd543 --- /dev/null +++ b/sys/modules/steam.nix @@ -0,0 +1,31 @@ +{ + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.local.sys.steam; +in { + options.local.sys.steam = { + enable = mkEnableOption "steam settings"; + }; + config = mkIf cfg.enable { + programs.steam = { + enable = true; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + localNetworkGameTransfers.openFirewall = true; + }; + + environment = { + systemPackages = with pkgs; + [ + protontricks + protonup + protonup-ng + winetricks + ]; + }; + }; +} diff --git a/sys/platforms/posixlycorrect/default.nix b/sys/platforms/posixlycorrect/default.nix index 23409ac..b4caa87 100644 --- a/sys/platforms/posixlycorrect/default.nix +++ b/sys/platforms/posixlycorrect/default.nix @@ -19,6 +19,7 @@ graphics.enable = true; virtualisation.enable = true; androidSupport.enable = true; + steam.enable = true; users = { fabian = {