Files
nix-config-ryan4yin/outputs/x86_64-linux/tests/agent-profile/expr.nix
T
ryan4yin | 二花 9a307b313d refactor: host profiles; give ruby, kana and aquamarine the TUI home (#512)
- Add the agent profile (modules/nixos/agent.nix: rootless Podman, linger,
  nix-ld) with home/linux/tui.nix as its home role; ruby, kana and
  aquamarine use it, so hosts no longer import from hosts/idols-ruby.
- Gate nushell's ~/.secrets source behind modules.shell.secrets.enable,
  off on agent hosts.
- Persist the TUI home state on aquamarine's tmpfs root.
- Document host profiles in hosts/README.md; add tests/agent-profile and
  drop the x86_64 colmena-parity test, which needs mysecrets.

Assisted-by: Claude Code (claude-opus-5-5)
2026-11-03 04:57:06 -06:00

42 lines
1.2 KiB
Nix

# The `agent` profile (hosts/README.md#host-profiles): every agent host gets
# the full TUI home role, and the system side only carries what needs root.
{
myvars,
lib,
outputs,
}:
let
username = myvars.username;
hosts = [
"aquamarine"
"ruby"
"kana"
];
hasPackage = name: lib.any (package: (package.pname or "") == name);
in
lib.genAttrs hosts (
name:
let
system = outputs.nixosConfigurations.${name}.config;
home = system.home-manager.users.${username};
in
{
# home role: home/linux/tui.nix
agentsFromHome = hasPackage "codex" home.home.packages;
devToolsFromHome = hasPackage "kubectl" home.home.packages;
# ~/.secrets is synced to the desktops only; sourcing it would break nushell.
nushellSecrets = home.modules.shell.secrets.enable;
# system module: modules/nixos/agent.nix
nixLd = system.programs.nix-ld.enable;
rootlessPodman = system.virtualisation.podman.enable;
docker = system.virtualisation.docker.enable;
linger = system.users.users.${username}.linger;
# User tools stay out of the system profile.
agentsInSystem = hasPackage "codex" system.environment.systemPackages;
# host switch
computerUse = system.modules.desktop.computerUse.enable;
}
)