refactor(yolo): take the agent-skills units from their own module
CI / lint (push) Successful in 30s
CI / eval (push) Successful in 1m57s

pr-daemon, hourlog and week-review are defined by the agent-skills
home-manager module now, next to the scripts they run; this host just
enables them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Miguel Palhas
2026-08-19 22:20:44 +01:00
parent 7580edb82c
commit ba5b618e49
3 changed files with 15 additions and 96 deletions
+8 -1
View File
@@ -64,7 +64,14 @@ in
};
};
programs.agentSkills.machine = "yolo";
# This is the one box that runs the agent-skills units; each starts a session,
# so a second machine enabling them would run the same job twice.
programs.agentSkills = {
machine = "yolo";
prDaemon.enable = true;
hourlog.enable = true;
weekReview.enable = true;
};
programs.nh.flake = "/home/naps62/tea/nixos-config";
# Idle lock and dpms-off blank the virtual output: Sunshine then captures a
+3 -91
View File
@@ -92,96 +92,8 @@ in
};
Install.WantedBy = [ "default.target" ];
};
pr-daemon = {
Unit = {
Description = "pr-daemon watches GitHub/Gitea PRs and routes them to aoe sessions";
Documentation = [ "https://git.naps.pt/yolo/agent-skills" ];
After = [ "network.target" ];
# Both are required and neither is in the nix store: the config names
# the repos, the env file holds the read-only forge tokens. Missing
# config would crash-loop against Restart=always.
ConditionPathExists = [
"%h/.config/reviewer/config.json"
"%h/.config/reviewer/env"
];
# Same restart-budget trap as `rev` above.
StartLimitIntervalSec = 0;
};
Service = {
Type = "simple";
WorkingDirectory = "%h";
ExecStart = "${pkgs.bun}/bin/bun %h/tea/agent-skills/bin/reviewer-poll.ts";
EnvironmentFile = "%h/.config/reviewer/env";
# aoe and git come from the profile dirs, not from a user unit's default
# PATH. TMUX_TMPDIR keeps the sessions it starts on the same tmux server
# the shell and TUI use, instead of a second one under /tmp.
Environment = [
"PATH=${toolPath}"
"TMUX_TMPDIR=%t"
];
Restart = "always";
RestartSec = 5;
# The agent tmux sessions this daemon starts land in its cgroup, so the
# default control-group kill takes every running agent down with it.
KillMode = "process";
};
Install.WantedBy = [ "default.target" ];
};
hourlog = {
Unit = {
Description = "Start the Friday hour log in a tmux session";
Documentation = [ "https://git.naps.pt/yolo/agent-skills" ];
ConditionPathIsDirectory = "%h/tea/agent-skills";
};
Service = {
Type = "oneshot";
ExecStart = "%h/tea/agent-skills/bin/hourlog-session.sh";
Environment = [ "PATH=${toolPath}" ];
# This unit may be what starts the tmux server; the default cgroup kill
# would take it back down as soon as ExecStart returns.
KillMode = "process";
};
};
week-review = {
Unit = {
Description = "Start the weekly agent-skills review in a tmux session";
Documentation = [ "https://git.naps.pt/yolo/agent-skills" ];
ConditionPathIsDirectory = "%h/tea/agent-skills";
};
Service = {
Type = "oneshot";
ExecStart = "%h/tea/agent-skills/bin/week-review-session.sh";
Environment = [ "PATH=${toolPath}" ];
KillMode = "process";
};
};
};
systemd.user.timers = {
hourlog = {
Unit.Description = "Friday hour log, 18:00 Europe/Lisbon";
Timer = {
# Zone suffix pinned because the machine clock is UTC; keeps it at 18:00
# wall time across DST.
OnCalendar = "Fri 18:00 Europe/Lisbon";
Persistent = true;
AccuracySec = "1min";
};
Install.WantedBy = [ "timers.target" ];
};
week-review = {
Unit.Description = "Weekly agent-skills review, Fridays 17:00 Europe/Lisbon";
Timer = {
OnCalendar = "Fri 17:00 Europe/Lisbon";
Persistent = true;
AccuracySec = "1min";
};
Install.WantedBy = [ "timers.target" ];
};
};
}
# pr-daemon, hourlog and week-review are not here: their units ship with the
# scripts they run, in the agent-skills module. This host opts in with
# programs.agentSkills.*.enable in home/yolo/default.nix.