nixos/sfh: Add slop-cannon container for agents

A container on `sfh` for coding agents driven remotely through Paseo,
using our relay on `middleman`. Agents run as the unprivileged
`slop-cannon` user; Claude managed settings disable bypass mode and
deny raw deploy and `ssh-machine` access.

Move the Claude Code and Codex configuration out of `gui` into a
shared `my.agents` home-manager module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-16 00:39:48 +00:00
co-authored by Claude Opus 5.5
parent 5af71ea231
commit a62b8351fa
17 changed files with 599 additions and 116 deletions
+1
View File
@@ -2,6 +2,7 @@
home-manager.modules = {
common = ./common.nix;
gui = ./gui;
agents = ./agents;
deploy-rs = ./deploy-rs.nix;
swaync = ./swaync.nix;
};
+54
View File
@@ -0,0 +1,54 @@
{ lib, pkgs, inputs, config, options, ... }:
let
inherit (lib) mkIf optionalAttrs;
inherit (lib.my) mkBoolOpt';
cfg = config.my.agents;
agentPkgs = inputs.llm-agents.packages.${pkgs.stdenv.hostPlatform.system};
in
{
options.my.agents = {
enable = mkBoolOpt' false "Whether to install and configure coding agents (Claude Code, Codex).";
};
config = mkIf cfg.enable {
programs = {
# TODO: Remove mutableSettings guard when Home Manager 26.11 releases; 26.05 lacks it.
codex = {
enable = true;
package = agentPkgs.codex;
settings.sandbox_workspace_write.network_access = true;
settings.tui = {
status_line = [
"model-with-reasoning"
"current-dir"
"five-hour-limit"
"weekly-limit"
"context-used"
"context-window-size"
"total-input-tokens"
"total-output-tokens"
"used-tokens"
];
status_line_use_colors = true;
};
} // optionalAttrs (options.programs.codex ? mutableSettings) {
mutableSettings = true;
};
claude-code = {
enable = true;
package = agentPkgs.claude-code;
settings = {
model = "opus";
theme = "auto";
statusLine = {
type = "command";
command = ./claude-statusline.sh;
padding = 0;
};
};
};
};
};
}
+12
View File
@@ -169,6 +169,18 @@ in
HostName = "ch-s010.rsync";
};
# Coding agents run as `slop-cannon`; never forward an agent there
slop-cannon = {
HostName = "slop-cannon-ctr.${lib.my.c.home.domain}";
User = "slop-cannon";
ForwardAgent = "no";
};
slop-cannon-dev = {
HostName = "slop-cannon-ctr.${lib.my.c.home.domain}";
User = "dev";
ForwardAgent = "no";
};
shoe = {
Host = "shoe.netsoc.tcd.ie shoe";
User = "netsoc";
+2 -37
View File
@@ -73,6 +73,8 @@ in
}
];
my.agents.enable = mkDefault true;
home = {
packages = (with pkgs; [
xdg-utils
@@ -186,43 +188,6 @@ in
};
};
};
# TODO: Remove mutableSettings guard when Home Manager 26.11 releases; 26.05 lacks it.
codex = {
enable = true;
package = inputs.llm-agents.packages.${pkgs.stdenv.hostPlatform.system}.codex;
settings.sandbox_workspace_write.network_access = true;
settings.tui = {
status_line = [
"model-with-reasoning"
"current-dir"
"five-hour-limit"
"weekly-limit"
"context-used"
"context-window-size"
"total-input-tokens"
"total-output-tokens"
"used-tokens"
];
status_line_use_colors = true;
};
} // optionalAttrs (options.programs.codex ? mutableSettings) {
mutableSettings = true;
};
claude-code = {
enable = true;
package = inputs.llm-agents.packages.${pkgs.stdenv.hostPlatform.system}.claude-code;
settings = {
model = "opus";
theme = "auto";
statusLine = {
type = "command";
command = ./claude-statusline.sh;
padding = 0;
};
};
};
};
}