mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 16:33:15 +00:00
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: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
parent
7ae88ec0f3
commit
dba4f38d34
@ -100,12 +100,10 @@ in
|
|||||||
] ++ cfg.runtimePackages;
|
] ++ cfg.runtimePackages;
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
|
||||||
User = "renovate";
|
User = "renovate";
|
||||||
Group = "renovate";
|
Group = "renovate";
|
||||||
DynamicUser = true;
|
DynamicUser = true;
|
||||||
LoadCredential = lib.mapAttrsToList (name: value: "SECRET-${name}:${value}") cfg.credentials;
|
LoadCredential = lib.mapAttrsToList (name: value: "SECRET-${name}:${value}") cfg.credentials;
|
||||||
RemainAfterExit = false;
|
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
CacheDirectory = "renovate";
|
CacheDirectory = "renovate";
|
||||||
StateDirectory = "renovate";
|
StateDirectory = "renovate";
|
||||||
|
@ -58,12 +58,12 @@ import ./make-test-python.nix (
|
|||||||
machine.succeed("git -C /tmp/kitty push origin")
|
machine.succeed("git -C /tmp/kitty push origin")
|
||||||
|
|
||||||
machine.succeed(f"echo '{accessToken}' > /etc/renovate-token")
|
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 list --repo meow/kitty | grep 'Configure Renovate'")
|
||||||
machine.succeed("tea pulls merge --repo meow/kitty 1")
|
machine.succeed("tea pulls merge --repo meow/kitty 1")
|
||||||
|
|
||||||
machine.systemctl("start renovate.service")
|
machine.systemctl("start --wait renovate.service")
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user