diff --git a/modules/servers/drone-exec-runner.nix b/modules/servers/drone-exec-runner.nix index 373b993..3f34b9c 100644 --- a/modules/servers/drone-exec-runner.nix +++ b/modules/servers/drone-exec-runner.nix @@ -6,6 +6,16 @@ let runnerOpts = { options = { enable = mkEnableOption "Enable an Drone CI/CD Exec Runner"; + restartIfChanged = mkOption { + type = bool; + default = true; + description = ''Restart the runner if configuration changes. + Consider the scenario where the runner runs on the same machine where it gets deployed and + this runner is redeploying itself. + If restart if changed is true, the runner gets killed during the process, this is very bad. + To enable these scenarios, restart manually the runners once deployment is done. + ''; + }; package = mkOption { type = package; default = pkgs.drone-runner-exec; @@ -54,6 +64,8 @@ in systemd.services = mapAttrs' (runnerName: cfg: nameValuePair ("drone-exec-runner-${runnerName}") ({ wantedBy = [ "multi-user.target" ]; + inherit restartIfChanged; + confinement.enable = true; confinement.packages = cfg.allowedPackages; path = cfg.allowedPackages;