2021-12-24 10:47:42 +01:00
|
|
|
{ config, pkgs, ... }: {
|
2021-12-23 20:39:49 +01:00
|
|
|
sops.secrets.cachix-agent-token.sopsFile = ./secrets.yaml;
|
|
|
|
|
2021-12-24 11:01:09 +01:00
|
|
|
systemd.services.cachix-deploy-agent = let
|
|
|
|
sources = import ../../nix/sources.nix {};
|
|
|
|
in {
|
2021-12-23 20:39:49 +01:00
|
|
|
wantedBy = [ "multi-user.target" ];
|
2021-12-24 11:03:08 +01:00
|
|
|
path = [ config.nix.package ];
|
2021-12-24 11:09:37 +01:00
|
|
|
restartIfChanged = false;
|
2021-12-23 20:39:49 +01:00
|
|
|
serviceConfig = {
|
2022-01-05 09:31:13 +01:00
|
|
|
Restart = "on-failure";
|
2021-12-23 20:39:49 +01:00
|
|
|
EnvironmentFile = config.sops.secrets.cachix-agent-token.path;
|
2021-12-24 11:01:09 +01:00
|
|
|
ExecStart = "${import sources.cachix {}}/bin/cachix deploy agent ${config.networking.hostName}";
|
2021-12-23 20:39:49 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|