modularize steam

This commit is contained in:
Fabian Montero 2025-01-27 19:52:25 -06:00
parent 9f0e9811e3
commit cbda46edd5
Signed by: fabian
GPG key ID: 1FFAC35E1798174F
6 changed files with 34 additions and 15 deletions

View file

@ -8,7 +8,7 @@
./terminal ./terminal
./neovim.nix ./neovim.nix
./baseline.nix ./baseline.nix
./gaming ./gaming.nix
./yubikey.nix ./yubikey.nix
./browsers.nix ./browsers.nix
./gui ./gui

View file

@ -12,11 +12,6 @@ in {
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = [ home.packages = [
# Steam. todo: move to the steam module later
(pkgs.callPackage ./package.nix {})
pkgs.protonup
pkgs.winetricks
pkgs.protontricks
pkgs.lutris pkgs.lutris
pkgs.openrct2 pkgs.openrct2
pkgs.prismlauncher pkgs.prismlauncher

View file

@ -1,9 +0,0 @@
{
writeShellScriptBin,
steam-run,
steam,
...
}:
writeShellScriptBin "steam" ''
exec ${steam-run}/bin/steam-run ${steam}/bin/steam -console
''

View file

@ -14,5 +14,6 @@
./users.nix ./users.nix
./bluetooth.nix ./bluetooth.nix
./net.nix ./net.nix
./steam.nix
]; ];
} }

31
sys/modules/steam.nix Normal file
View file

@ -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
];
};
};
}

View file

@ -19,6 +19,7 @@
graphics.enable = true; graphics.enable = true;
virtualisation.enable = true; virtualisation.enable = true;
androidSupport.enable = true; androidSupport.enable = true;
steam.enable = true;
users = { users = {
fabian = { fabian = {