Unverified Commit dba4f38d authored by Sefa Eyeoglu's avatar Sefa Eyeoglu
Browse files

nixos/renovate: set service type to simple



By setting `Type=oneshot` for longer running services like Renovate, the
unit remains in the `activating` state during the whole lifetime of the
main process. This is probably desirable for short scripts/programs that
run setup tasks for other services, like setting up network interfaces.
In those cases one can also make use of `RemainAfterExit` to treat the
service as `active` once the main process exits.

In the case of Renovate we do not make use of `RemainAfterExit` and we
have a longer running task, so `Type=simple` works better here.

Signed-off-by: default avatarSefa Eyeoglu <contact@scrumplex.net>
parent 7ae88ec0
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -100,12 +100,10 @@ in
      ] ++ cfg.runtimePackages;

      serviceConfig = {
        Type = "oneshot";
        User = "renovate";
        Group = "renovate";
        DynamicUser = true;
        LoadCredential = lib.mapAttrsToList (name: value: "SECRET-${name}:${value}") cfg.credentials;
        RemainAfterExit = false;
        Restart = "on-failure";
        CacheDirectory = "renovate";
        StateDirectory = "renovate";
+2 −2
Original line number Diff line number Diff line
@@ -58,12 +58,12 @@ import ./make-test-python.nix (
      machine.succeed("git -C /tmp/kitty push origin")

      machine.succeed(f"echo '{accessToken}' > /etc/renovate-token")
      machine.systemctl("start renovate.service")
      machine.systemctl("start --wait renovate.service")

      machine.succeed("tea pulls list --repo meow/kitty | grep 'Configure Renovate'")
      machine.succeed("tea pulls merge --repo meow/kitty 1")

      machine.systemctl("start renovate.service")
      machine.systemctl("start --wait renovate.service")
    '';
  }
)