From 6923bd874bb9ecbd12bb65a0389c92520a07a2bc Mon Sep 17 00:00:00 2001 From: alexion Date: Tue, 15 Sep 2026 17:08:49 -0400 Subject: [PATCH] fix(nixos): stop palworld auto-start --- configs/nixos/guests/palworld.nix | 8 +++++++- configs/nixos/hosts/pikachu/default.nix | 1 + configs/nixos/modules/services/games/palworld.nix | 7 +++++++ configs/nixos/modules/services/steamcmd.nix | 8 +++++++- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/configs/nixos/guests/palworld.nix b/configs/nixos/guests/palworld.nix index 212a20d..0cc4005 100644 --- a/configs/nixos/guests/palworld.nix +++ b/configs/nixos/guests/palworld.nix @@ -50,6 +50,12 @@ in description = "Public IP address advertised by the Palworld server."; }; + autoStart = lib.mkOption { + type = lib.types.bool; + default = true; + description = "Start the Palworld server during normal boot."; + }; + passwordSecret = lib.mkOption { type = lib.types.str; default = "services/game-servers/password"; @@ -82,7 +88,7 @@ in guests.palworld = { interior.modules.services.games.palworld = { enable = true; - inherit (cfg) serverName port publicIP; + inherit (cfg) serverName port publicIP autoStart; inherit steamDir installDir stateDir; passwordFile = "/run/secrets/${cfg.passwordSecret}"; adminPasswordFile = "/run/secrets/${cfg.adminPasswordSecret}"; diff --git a/configs/nixos/hosts/pikachu/default.nix b/configs/nixos/hosts/pikachu/default.nix index 2853ea6..6ed01b0 100644 --- a/configs/nixos/hosts/pikachu/default.nix +++ b/configs/nixos/hosts/pikachu/default.nix @@ -94,6 +94,7 @@ installPath = "/pikachu/data/servers/palworld/tracion"; statePath = "/pikachu/media/games/servers/palworld/tracion"; serverName = "Tracion"; + autoStart = false; adminPasswordSecret = "services/game-servers/admin/password"; publicIP = config.guests.palworld.address; reverseProxy = { diff --git a/configs/nixos/modules/services/games/palworld.nix b/configs/nixos/modules/services/games/palworld.nix index 7c321da..0e69d43 100644 --- a/configs/nixos/modules/services/games/palworld.nix +++ b/configs/nixos/modules/services/games/palworld.nix @@ -56,6 +56,12 @@ description = "Advertise the server in Palworld's public lobby."; }; + autoStart = lib.mkOption { + type = lib.types.bool; + default = true; + description = "Start the Palworld server during normal boot."; + }; + rcon = { enable = lib.mkEnableOption "Palworld RCON" // { default = true; @@ -126,6 +132,7 @@ inherit (service) steamDir installDir stateDir; serviceName = "palworld-${lib.toLower service.serverName}"; appId = 2394010; + inherit (service) autoStart; executable = "${startScript}"; arguments = [ diff --git a/configs/nixos/modules/services/steamcmd.nix b/configs/nixos/modules/services/steamcmd.nix index 4720fc4..0152dd4 100644 --- a/configs/nixos/modules/services/steamcmd.nix +++ b/configs/nixos/modules/services/steamcmd.nix @@ -65,6 +65,12 @@ default = [ ]; description = "TCP ports opened for the game service."; }; + + autoStart = lib.mkOption { + type = lib.types.bool; + default = true; + description = "Start the game service during normal boot."; + }; }; config = lib.mkMerge [ @@ -150,7 +156,7 @@ "steamcmd-${service.serviceName}-update.service" ]; wants = [ "network-online.target" ]; - wantedBy = [ "multi-user.target" ]; + wantedBy = lib.mkIf service.autoStart [ "multi-user.target" ]; serviceConfig = { Type = "simple"; User = user;