Unverified Commit 95324ddf authored by Domen Kožar's avatar Domen Kožar Committed by GitHub
Browse files

Merge pull request #181367 from domenkozar/cachix-agent-restarts

cachix-agent: allow restarts now that deployments are subprocesses
parents e7d9b66a c46a3dc5
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -52,12 +52,15 @@ in {
      path = [ config.nix.package ];
      wantedBy = [ "multi-user.target" ];

      # don't restart while changing
      restartIfChanged = false;
      # Cachix requires $USER to be set
      environment.USER = "root";

      # don't stop the service if the unit disappears
      unitConfig.X-StopOnRemoval = false;

      environment.USER = "root";
      serviceConfig = {
        # we don't want to kill children processes as those are deployments
        KillMode = "process";
        Restart = "on-failure";
        EnvironmentFile = cfg.credentialsFile;
        ExecStart = "${cfg.package}/bin/cachix ${lib.optionalString cfg.verbose "--verbose"} deploy agent ${cfg.name} ${if cfg.profile != null then profile else ""}";