diff --git a/nixos/stacks/ps2.live/agg_metagame.nix b/nixos/stacks/ps2.live/agg_metagame.nix index 1bbe855..78fcfe0 100644 --- a/nixos/stacks/ps2.live/agg_metagame.nix +++ b/nixos/stacks/ps2.live/agg_metagame.nix @@ -26,4 +26,23 @@ in { ports = [ "${port 0}:${port 0}" ]; }; }; + + systemd.services.restart-upgrade-aggmeta = { + serviceConfig.Type = "oneshot"; + script = '' + ${pkgs.podman}/bin/podman pull ${config.virtualisation.oci-containers.containers.metagame.image} + ${pkgs.podman}/bin/podman pull ${config.virtualisation.oci-containers.containers.aggpop.image} + + systemctl restart podman-aggpop + systemctl restart podman-metagame + ''; + }; + + systemd.timers.restart-upgrade-aggmeta = { + wantedBy = [ "timers.target" ]; + timerConfig = { + Unit = "restart-upgrade-aggmeta.service"; + OnUnitActiveSec = "360m"; + }; + }; } diff --git a/nixos/stacks/ps2.live/extras.nix b/nixos/stacks/ps2.live/extras.nix index 6d7b9bd..075400f 100644 --- a/nixos/stacks/ps2.live/extras.nix +++ b/nixos/stacks/ps2.live/extras.nix @@ -15,4 +15,21 @@ ]; }; }; + + systemd.services.restart-upgrade-extras = { + serviceConfig.Type = "oneshot"; + script = '' + ${pkgs.podman}/bin/podman pull ${virtualisation.oci-containers.containers.roombot_ps2c.image} + + systemctl restart podman-roombot_ps2c + ''; + }; + + systemd.timers.restart-upgrade-extras = { + wantedBy = [ "timers.target" ]; + timerConfig = { + Unit = "restart-upgrade-extras.service"; + OnUnitActiveSec = "690m"; + }; + }; } diff --git a/nixos/stacks/ps2.live/saerro.nix b/nixos/stacks/ps2.live/saerro.nix index 1bc7fc3..eae8ed5 100644 --- a/nixos/stacks/ps2.live/saerro.nix +++ b/nixos/stacks/ps2.live/saerro.nix @@ -60,11 +60,24 @@ in { ''; }; - # TODO: Automatic restart and pull - # services.nginx.virtualHosts = { - # "saerro.ps2.live" = { - # serverAliases = [ "saerro-new.ps2.live" ]; - # locations."/".proxyPass = "http://127.0.0.1:${port 1}"; - # }; - # }; + systemd.services.restart-upgrade-saerro = { + serviceConfig.Type = "oneshot"; + script = '' + ${pkgs.podman}/bin/podman pull ${config.virtualisation.oci-containers.containers.saerro_ws.image} + ${pkgs.podman}/bin/podman pull ${config.virtualisation.oci-containers.containers.saerro_api.image} + ${pkgs.podman}/bin/podman pull ${config.virtualisation.oci-containers.containers.saerro_maint.image} + + systemctl restart podman-saerro_ws + systemctl restart podman-saerro_api + systemctl restart podman-saerro_maint + ''; + }; + + systemd.timers.restart-upgrade-saerro = { + wantedBy = [ "timers.target" ]; + timerConfig = { + Unit = "restart-upgrade-saerro.service"; + OnUnitActiveSec = "420m"; + }; + }; }