2023-12-26 00:48:43 -05:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
secrets = config.sops.secrets;
|
|
|
|
vars = config.vars;
|
|
|
|
in {
|
|
|
|
services.nix-serve = {
|
|
|
|
enable = true;
|
|
|
|
secretKeyFile = secrets.binary-cache-key.path;
|
|
|
|
};
|
|
|
|
|
2023-12-27 11:39:38 -05:00
|
|
|
# Populate cache
|
2023-12-26 00:48:43 -05:00
|
|
|
systemd = {
|
|
|
|
services.buildAll = {
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "oneshot";
|
|
|
|
User = vars.user;
|
|
|
|
Group = config.users.users.${vars.user}.group;
|
|
|
|
};
|
2023-12-27 11:39:38 -05:00
|
|
|
|
|
|
|
path = with pkgs; [
|
|
|
|
git
|
|
|
|
nix
|
|
|
|
nixci
|
|
|
|
openssh
|
|
|
|
];
|
|
|
|
|
2023-12-26 00:48:43 -05:00
|
|
|
script = ''
|
|
|
|
cd /tmp
|
2023-12-27 11:39:38 -05:00
|
|
|
git clone https://git.nelim.org/matt1432/nixos-configs.git nix-clone
|
|
|
|
cd nix-clone
|
|
|
|
nix flake update
|
|
|
|
nixci .
|
|
|
|
cd ..
|
|
|
|
rm -r nix-clone
|
2023-12-26 00:48:43 -05:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
timers.buildAll = {
|
|
|
|
wantedBy = ["timers.target"];
|
|
|
|
partOf = ["buildAll.service"];
|
2023-12-27 11:39:38 -05:00
|
|
|
timerConfig.OnCalendar = ["0:00:00"];
|
2023-12-26 00:48:43 -05:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|