diff --git a/hosts/workstation/systemd.nix b/hosts/workstation/systemd.nix index f83ef11..103e377 100644 --- a/hosts/workstation/systemd.nix +++ b/hosts/workstation/systemd.nix @@ -50,7 +50,6 @@ in { }; check-nic = { description = "Adjust tailscale MTU based on location"; - unitConfig = { Type = "simple"; }; serviceConfig = { Type = "oneshot"; Environment = @@ -58,24 +57,62 @@ in { ExecStart = "/home/don/bin/check-nic"; }; }; + task-sync = { + description = "Sync taskwarrior"; + serviceConfig = { + Type = "oneshot"; + Environment = + "PATH=/run/current-system/sw/bin:/etc/profiles/per-user/don/bin:/home/don/bin"; + ExecStart = "/home/don/bin/sync-task"; + }; + }; + vdirsyncer = { + description = "Synchronize calendars and contacts"; + serviceConfig = { + Type = "oneshot"; + Environment = + "PATH=/run/current-system/sw/bin:/etc/profiles/per-user/don/bin:/home/don/bin"; + ExecStart = "/etc/profiles/per-user/don/bin/vdirsyncer sync"; + }; + }; }; timers = { check-nic = { + description = "Adjust tailscale MTU based on location"; wantedBy = [ "timers.target" ]; - partOf = [ "check-nic.service" ]; timerConfig = { - OnCalendar = "1m"; + OnUnitActiveSec = "1min"; + OnBootSec = "1m"; + AccuracySec = "1m"; Unit = "check-nic.service"; }; }; detect-reboot-for-upgrade = { + description = "Check if need to reboot for new kernel"; wantedBy = [ "timers.target" ]; - partOf = [ "detect-reboot-for-upgrade.service" ]; timerConfig = { - OnCalendar = "hourly"; + OnUnitActiveSec = "hourly"; Unit = "detect-reboot-for-upgrade.service"; }; }; + task-sync = { + description = "Sync taskwarrior"; + wantedBy = [ "timers.target" ]; + timerConfig = { + OnUnitActiveSec = "5min"; + OnBootSec = "1m"; + AccuracySec = "1m"; + Unit = "task-sync.service"; + }; + }; + vdirsyncer = { + description = "Synchronize calendars and contacts"; + wantedBy = [ "timers.target" ]; + timerConfig = { + OnUnitActiveSec = "5min"; + Unit = "vdirsyncer.service"; + }; + }; }; }; };