Merge pull request #190837 from domenkozar/cachix-agent-host

cachix-agent: add host option
This commit is contained in:
Domen Kožar 2022-09-11 21:35:58 +01:00 committed by GitHub
commit 3582beec60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,6 +29,12 @@ in {
description = lib.mdDoc "Profile name, defaults to 'system' (NixOS).";
};
host = mkOption {
type = types.str;
default = null;
description = lib.mdDoc "Cachix uri to use.";
};
package = mkOption {
type = types.package;
default = pkgs.cachix;
@ -63,7 +69,10 @@ in {
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 cfg.profile else ""}";
ExecStart = ''
${cfg.package}/bin/cachix ${lib.optionalString cfg.verbose "--verbose"} ${lib.optionalString (cfg.host != null) "--host ${cfg.host}"} \
deploy agent ${cfg.name} ${if cfg.profile != null then cfg.profile else ""}
'';
};
};
};