hosts | moved systemd-primary up one, and point workstation and server at it

This commit is contained in:
Don Harper 2025-12-13 18:21:02 -06:00
parent 11d39a4d61
commit d142a451a6
4 changed files with 3 additions and 75 deletions

72
hosts/systemd-primary.nix Normal file
View file

@ -0,0 +1,72 @@
{
pkgs,
lib,
config,
...
}:
with lib; let
cfg = config.primary;
in {
options.primary = {enable = mkEnableOption "is primary host";};
config = mkIf cfg.enable {
systemd = {
user = {
services = {
do_agenda = {
description = "Send today's agenda";
unitConfig = {Type = "simple";};
serviceConfig = {
Type = "oneshot";
Environment = "PATH=/run/current-system/sw/bin:/etc/profiles/per-user/don/bin:/home/don/bin";
ExecStart = "/home/don/bin/do_agenda";
};
};
do_agenda_tomorrow = {
description = "Send tomorrow's agenda";
unitConfig = {Type = "simple";};
serviceConfig = {
Type = "oneshot";
Environment = "PATH=/run/current-system/sw/bin:/etc/profiles/per-user/don/bin:/home/don/bin";
ExecStart = "/home/don/bin/do_agenda.tomorrow";
};
};
gosleep = {
description = "Adjust tailscale MTU based on location";
unitConfig = {Type = "simple";};
serviceConfig = {
Type = "oneshot";
Environment = "PATH=/run/current-system/sw/bin:/etc/profiles/per-user/don/bin:/home/don/bin";
ExecStart = "/home/don/bin/gosleep";
};
};
};
timers = {
do_agenda = {
wantedBy = ["timers.target"];
partOf = ["do_agenda.service"];
timerConfig = {
OnCalendar = "05:00";
Unit = "do_agenda.service";
};
};
do_agenda_tomorrow = {
wantedBy = ["timers.target"];
partOf = ["do_agenda_tomorrow.service"];
timerConfig = {
OnCalendar = "20:00";
Unit = "do_agenda_tomorrow.service";
};
};
gosleep = {
wantedBy = ["timers.target"];
partOf = ["gosleep.service"];
timerConfig = {
OnCalendar = "1m";
Unit = "gosleep.service";
};
};
};
};
};
};
}