cachix-agent: add host option

This commit is contained in:
Domen Kožar 2022-09-11 21:07:45 +01:00
parent 44ef157f55
commit fbc23b491a

View file

@ -29,6 +29,12 @@ in {
description = lib.mdDoc "Profile name, defaults to 'system' (NixOS)."; 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 { package = mkOption {
type = types.package; type = types.package;
default = pkgs.cachix; default = pkgs.cachix;
@ -63,7 +69,10 @@ in {
KillMode = "process"; KillMode = "process";
Restart = "on-failure"; Restart = "on-failure";
EnvironmentFile = cfg.credentialsFile; 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 ""}
'';
}; };
}; };
}; };