mauville/home: implify systemd units

This commit is contained in:
Aly Raffauf 2024-07-06 20:08:53 -04:00
parent 0f523dd24c
commit 4d817c1f72

View file

@ -18,11 +18,9 @@
systemd.user = {
services = {
backblaze-sync = {
Unit = {
Description = "Backup to Backblaze.";
};
Service = {
ExecStart = "${pkgs.writeShellScript "backblaze-sync" ''
Unit.Description = "Backup to Backblaze.";
Service.ExecStart = "${pkgs.writeShellScript "backblaze-sync" ''
declare -A backups
backups=(
['/home/aly/pics/camera']="b2://aly-camera"
@ -42,14 +40,11 @@
done
''}";
};
};
build-hosts = {
Unit = {
Description = "Build nixosConfiguration for each host.";
};
Service = {
ExecStart = "${pkgs.writeShellScript "build-hosts" ''
Unit.Description = "Build nixosConfiguration for each host.";
Service.ExecStart = "${pkgs.writeShellScript "build-hosts" ''
hosts=(
fallarbor
lavaridge
@ -63,30 +58,17 @@
''}";
};
};
};
timers = {
backblaze-sync = {
Unit = {
Description = "Daily backups to Backblaze.";
};
Install = {
WantedBy = ["timers.target"];
};
Timer = {
OnCalendar = "*-*-* 03:00:00";
};
Install.WantedBy = ["timers.target"];
Timer.OnCalendar = "*-*-* 03:00:00";
Unit.Description = "Daily backups to Backblaze.";
};
build-hosts = {
Unit = {
Description = "Build hosts daily.";
};
Install = {
WantedBy = ["timers.target"];
};
Timer = {
OnCalendar = "*-*-* 06:00:00";
};
Install.WantedBy = ["timers.target"];
Timer.OnCalendar = "*-*-* 06:00:00";
Unit.Description = "Build hosts daily.";
};
};
};