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).";
};
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 ""}
'';
};
};
};