hosts | move primary systemd timers to server, and enable it on fred
This commit is contained in:
parent
27e2cb8bb2
commit
f15b8e4478
4 changed files with 75 additions and 1 deletions
|
|
@ -26,4 +26,6 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
primary.enable = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@
|
||||||
auto-cpufreq.enable = true;
|
auto-cpufreq.enable = true;
|
||||||
gnome-calendar.enable = true;
|
gnome-calendar.enable = true;
|
||||||
};
|
};
|
||||||
primary.enable = true;
|
primary.enable = false;
|
||||||
|
ollama.enable = true;
|
||||||
wm = {sway.enable = true;};
|
wm = {sway.enable = true;};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ in {
|
||||||
../vars.nix
|
../vars.nix
|
||||||
# ./tailscale.nix
|
# ./tailscale.nix
|
||||||
./upgrade-diff.nix
|
./upgrade-diff.nix
|
||||||
|
./systemd-primary.nix
|
||||||
../../modules/beszel-agent.nix
|
../../modules/beszel-agent.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
70
hosts/server/systemd-primary.nix
Normal file
70
hosts/server/systemd-primary.nix
Normal file
|
|
@ -0,0 +1,70 @@
|
||||||
|
{ 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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue