fix(nixos): keep palworld server stopped by default

This commit was merged in pull request #50.
This commit is contained in:
2026-09-15 19:03:00 -04:00
parent aa1a330ef3
commit fca37666d3
4 changed files with 22 additions and 2 deletions

View File

@@ -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 after the guest reaches network readiness.";
};
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 =
[

View File

@@ -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 after the guest reaches network readiness.";
};
};
config = lib.mkMerge [
@@ -146,7 +152,7 @@
description = "Queue ${service.serviceName} game server startup";
after = [ "network-online.target" ];
wants = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ];
wantedBy = lib.mkIf service.autoStart [ "multi-user.target" ];
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.systemd}/bin/systemctl --no-block start ${service.serviceName}.service";