2022-01-21 17:06:18 +00:00
|
|
|
{ pkgs, ... }:
|
|
|
|
let
|
|
|
|
in
|
|
|
|
{
|
|
|
|
systemd.services.copy-to-cache = {
|
|
|
|
enable = true;
|
|
|
|
description = "Copy nix cache to cache.int.chir.rs";
|
|
|
|
script = ''
|
|
|
|
#!${pkgs.bash}/bin/bash
|
|
|
|
${pkgs.nix}/bin/nix copy --to 's3://cache.int.chir.rs?scheme=https&endpoint=minio.int.chir.rs' --all
|
|
|
|
'';
|
|
|
|
unitConfig = {
|
2022-01-21 17:13:45 +00:00
|
|
|
User = "darkkirb";
|
|
|
|
Group = "users";
|
2022-01-21 17:06:18 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
systemd.timers.copy-to-cache = {
|
|
|
|
enable = true;
|
|
|
|
description = "Copy nix cache to cache.int.chir.rs";
|
|
|
|
requires = [ "copy-to-cache.service" ];
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
timerConfig = {
|
2022-01-21 17:12:43 +00:00
|
|
|
OnUnitActiveSec = 3600;
|
|
|
|
OnBootSec = 3600;
|
2022-01-21 17:06:18 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|