diff --git a/nixos/stacks/ps2.live/saerro.nix b/nixos/stacks/ps2.live/saerro.nix index a5c5e60..4e4f655 100644 --- a/nixos/stacks/ps2.live/saerro.nix +++ b/nixos/stacks/ps2.live/saerro.nix @@ -9,7 +9,9 @@ "--pod=saerro" "--pull=always" ]; + autoStart = true; }; + ctrToSysd = names: map (x: "podman-saerro_${x}.service") names; in { sops.secrets.saerro = { @@ -23,6 +25,7 @@ in { PORT = port 1; WEBSOCKET_HEALTHCHECK = "http://127.0.0.1:${port 2}/healthz"; }; + dependsOn = [ "saerro_maint" "saerro_postgres" ]; } // containerGenerics; saerro_ws = { @@ -31,11 +34,13 @@ in { PORT = port 2; WORLDS = "all"; }; + dependsOn = [ "saerro_maint" "saerro_postgres" ]; } // containerGenerics; saerro_maint = { image = image "tasks"; cmd = [ "auto-maintenance" ]; + dependsOn = [ "saerro_postgres" ]; } // containerGenerics; saerro_postgres = { @@ -48,7 +53,7 @@ in { systemd.services.create-saerro-pod = { serviceConfig.Type = "oneshot"; - wantedBy = map (x: "podman-saerro_${x}.service") [ "api" "ws" "maint" "postgres" ]; + wantedBy = ctrToSysd [ "api" "ws" "maint" "postgres" ]; script = '' ${pkgs.podman}/bin/podman pod exists saerro || \ ${pkgs.podman}/bin/podman pod create -n saerro -p '0.0.0.0:${port 1}:${port 1}'