The user browses on the Steam Deck; agents run on arceus. Chrome's per-instance remote debugging (chrome://inspect toggle) exposes CDP only as a WebSocket at /devtools/browser, so playwright attach cannot use it and the HTTP /json paths return 403. bin/deck-browser speaks CDP directly with the standard library: tabs, text, html, shot, status, plus an opt-in unsafe-eval. Read-only by design - no click, type or navigate - because driving authenticated sessions is what gets accounts restricted. Opens the SSH tunnel itself and reuses an existing one. Registers the skill for every harness and tells agents it exists.
113 lines
5.9 KiB
Nix
113 lines
5.9 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
let
|
|
link = config.dotfiles.link;
|
|
|
|
# Skills live once, in config/skills. Each harness gets a symlink to the same
|
|
# files, so an edit is a git diff and no two copies can drift apart.
|
|
# cliSkills exist twice on purpose: the pi/Codex flavour reaches the wiki
|
|
# through codemode, the CLI flavour through the mcp bridge (no sandbox).
|
|
sharedSkills = [
|
|
"git" "gt" "mise-cli" "secrets_man" "searxng" "playwright-cli"
|
|
"context-discipline" "homelab-policies" "memory-layer" "roku-tv" "zsa-moonlander"
|
|
"deck-browser"
|
|
];
|
|
cliSkills = [ "infra-change" "wiki-update" "wiki-view" "lapis-memory" "handoff" ];
|
|
allSkills = sharedSkills ++ cliSkills;
|
|
skillSet = dir: names: lib.listToAttrs (map (n: lib.nameValuePair "${dir}/${n}" {
|
|
source = link "config/skills/${n}";
|
|
}) names);
|
|
cliSet = dir: lib.listToAttrs (map (n: lib.nameValuePair "${dir}/${n}" {
|
|
source = link "config/skills/cli/${n}";
|
|
}) cliSkills);
|
|
in
|
|
{
|
|
# Claude Code and pi install themselves (`dot apps`) so their auto-updaters keep working.
|
|
# Config is linked from the checkout so in-app edits show up in `git diff`.
|
|
home.packages = lib.optionals (config.dotfiles.gui && !config.dotfiles.work) [ pkgs.codex ];
|
|
|
|
home.file = {
|
|
".codex/hooks.json".source = link "config/codex/hooks.json";
|
|
".pi/agent/settings.json".source = link "config/pi/settings.json";
|
|
} // lib.optionalAttrs (!config.dotfiles.work) {
|
|
".claude/settings.json".source = link "config/claude/settings.json";
|
|
".claude/CLAUDE.md".source = link "config/claude/CLAUDE.md";
|
|
|
|
# Personal models, auto-model fallback and the free-pi agent directory.
|
|
# No secrets: API keys are `!secretctl ...` command lookups.
|
|
".pi/agent/models.json".source = link "config/pi/models.json";
|
|
".pi/agent/auto-model.json".source = link "config/pi/auto-model.json";
|
|
".free-pi/agent/models.json".source = link "config/free-pi/models.json";
|
|
".free-pi/agent/mcp.json".source = link "config/free-pi/mcp.json";
|
|
".free-pi/agent/AGENTS.md".source = link "config/free-pi/AGENTS.md";
|
|
|
|
# Free-model worker pool for the handoff pipeline (bin/free-agent, bin/handoff).
|
|
".config/free-agent/pool.json".source = link "config/free-agent/pool.json";
|
|
|
|
# Progressive context disclosure: a thin always-on AGENTS.md, the detail in
|
|
# skills, and an extension that refuses unbounded reads of large files.
|
|
"AGENTS.md".source = link "config/pi/AGENTS.md";
|
|
".pi/agent/AGENTS.md".source = link "config/pi/AGENTS.md";
|
|
".pi/agent/extensions/context-guard.ts".source = link "config/pi/extensions/context-guard.ts";
|
|
".free-pi/agent/extensions/context-guard.ts".source = link "config/pi/extensions/context-guard.ts";
|
|
|
|
# Cursor and Antigravity. Their wiki MCP server is the `mcp-wiki-remote`
|
|
# wrapper in bin/, which pulls the token from secretctl at launch.
|
|
".cursor/mcp.json".source = link "config/cursor/mcp.json";
|
|
".cursor/rules/homelab-agents.mdc".source = link "config/cursor/rules/homelab-agents.mdc";
|
|
".gemini/config/mcp_config.json".source = link "config/antigravity/mcp_config.json";
|
|
".gemini/config/config.json".source = link "config/antigravity/config.json";
|
|
".gemini/config/hooks.json".source = link "config/antigravity/hooks.json";
|
|
".gemini/config/skills.json".source = link "config/antigravity/skills.json";
|
|
".gemini/config/rules/antigravity-adapters.md".source = link "config/antigravity/rules/antigravity-adapters.md";
|
|
}
|
|
// skillSet ".pi/agent/skills" allSkills
|
|
// skillSet ".free-pi/agent/skills" allSkills
|
|
// skillSet ".codex/skills" allSkills
|
|
// skillSet ".agents/skills" (builtins.filter (n: !(builtins.elem n cliSkills)) sharedSkills)
|
|
// cliSet ".agents/skills";
|
|
# Free-model handoff pipeline. The daemon owns the tmux session "handoff" and
|
|
# starts one window per queued brief, so workers survive a terminal closing and
|
|
# are all back after a reboot. Rate limits are enforced by free-agent itself.
|
|
systemd.user.services.handoff = {
|
|
Unit = {
|
|
Description = "Free-model handoff queue (tmux workers)";
|
|
After = [ "default.target" ];
|
|
};
|
|
Service = {
|
|
ExecStart = "${config.home.homeDirectory}/.dotfiles/bin/handoff daemon";
|
|
Restart = "always";
|
|
RestartSec = 10;
|
|
# dotfiles/bin holds handoff + free-agent, .nix-profile and mise supply pi/node.
|
|
Environment = "PATH=${config.home.homeDirectory}/.dotfiles/bin:${config.home.homeDirectory}/.nix-profile/bin:${config.home.homeDirectory}/.local/bin:${config.home.homeDirectory}/.local/share/mise/shims:/run/current-system/sw/bin:/usr/bin:/bin";
|
|
};
|
|
Install.WantedBy = [ "default.target" ];
|
|
};
|
|
|
|
# Free lanes rot: OpenRouter retires :free slugs and providers change limits.
|
|
# A weekly probe writes the result to probe.log and fails the unit when a lane
|
|
# is dead, so "systemctl --user --failed" is the reminder instead of a surprise.
|
|
systemd.user.services.handoff-probe = {
|
|
Unit = { Description = "Probe every free-model lane in the handoff pool"; };
|
|
Service = {
|
|
Type = "oneshot";
|
|
ExecStart = "${config.home.homeDirectory}/.dotfiles/bin/free-agent --probe";
|
|
StandardOutput = "append:${config.home.homeDirectory}/.local/state/free-agent/probe.log";
|
|
StandardError = "append:${config.home.homeDirectory}/.local/state/free-agent/probe.log";
|
|
Environment = "PATH=${config.home.homeDirectory}/.dotfiles/bin:${config.home.homeDirectory}/.nix-profile/bin:${config.home.homeDirectory}/.local/bin:${config.home.homeDirectory}/.local/share/mise/shims:/run/current-system/sw/bin:/usr/bin:/bin";
|
|
};
|
|
};
|
|
|
|
systemd.user.timers.handoff-probe = {
|
|
Unit = { Description = "Weekly free-model lane probe"; };
|
|
Timer = {
|
|
OnCalendar = "Mon 08:00";
|
|
Persistent = true;
|
|
RandomizedDelaySec = 900;
|
|
};
|
|
Install.WantedBy = [ "timers.target" ];
|
|
};
|
|
|
|
# MCP servers carry tokens, so they are rendered from config/*/mcp*.json templates
|
|
# plus ~/.config/dotfiles/secrets.env by `dot secrets render` (never committed).
|
|
}
|