mauville/home: build select flake nixosConfigurations daily

This commit is contained in:
Aly Raffauf 2024-06-17 22:51:27 -04:00
parent ade653b20d
commit 69544be359

View file

@ -66,7 +66,8 @@
users.aly = { users.aly = {
imports = [../../homes/aly.nix]; imports = [../../homes/aly.nix];
systemd.user = { systemd.user = {
services.backblaze-sync = { services = {
backblaze-sync = {
Unit = { Unit = {
Description = "Backup to Backblaze."; Description = "Backup to Backblaze.";
}; };
@ -92,7 +93,30 @@
''}"; ''}";
}; };
}; };
timers.backblaze-sync = {
build-hosts = {
Unit = {
Description = "Build nixosConfiguration for each host.";
};
Service = {
ExecStart = "${pkgs.writeShellScript "build-hosts" ''
hosts=(
fallarbor
lavaridge
petalburg
rustboro
)
for h in "''${hosts[@]}"; do
nix build github:alyraffauf/nixcfg#nixosConfigurations.$h.config.system.build.toplevel
done
''}";
};
};
};
timers = {
backblaze-sync = {
Unit = { Unit = {
Description = "Daily backups to Backblaze."; Description = "Daily backups to Backblaze.";
}; };
@ -103,6 +127,18 @@
OnCalendar = "*-*-* 03:00:00"; OnCalendar = "*-*-* 03:00:00";
}; };
}; };
build-hosts = {
Unit = {
Description = "Build hosts daily.";
};
Install = {
WantedBy = ["timers.target"];
};
Timer = {
OnCalendar = "*-*-* 06:00:00";
};
};
};
}; };
}; };
users.dustin = import ../../homes/dustin.nix; users.dustin = import ../../homes/dustin.nix;