Skip to content

docs: agent onboarding — HOME agents.md symlink, git safe.directory, rebuild flow#26

Open
bpmct wants to merge 2 commits into
mainfrom
docs/agent-onboarding-and-git-safe-dir
Open

docs: agent onboarding — HOME agents.md symlink, git safe.directory, rebuild flow#26
bpmct wants to merge 2 commits into
mainfrom
docs/agent-onboarding-and-git-safe-dir

Conversation

@bpmct

@bpmct bpmct commented Jun 15, 2026

Copy link
Copy Markdown
Member

Make the box easier for agents (and humans) to work on after an install.sh install.

What & why

  • programs.git safe.directory whitelists the root-owned /etc/nixos-repo so interactive git/nix as the login user (or via sudo) no longer trip git's dubious-ownership guard (repository path ... is not owned by current user). The box's own services already pass -c safe.directory=... inline; this only covers ad-hoc use. Harmless on appliance ISOs where the repo is a read-only Nix store path (not a git repo).
  • ~/agents.md symlink via a tmpfiles L+ rule into every normal-user home, so an agent landing in $HOME finds the guide immediately. The motd only shows on interactive login — not over ssh host 'cmd', which is how an automation agent connects — so a file on disk is the reliable discovery path.
  • agents.md: document rebuilding via --flake /etc/nixos-repo, the /etc/nixos symlink-dir trap (--flake /etc/nixos fails because that dir holds only a flake.nix symlink, so Nix can't find the sibling files), and the harmless Git tree dirty warning + the intent-to-add re-add command.

Validation

  • nixos-rebuild dry-build --flake /etc/nixos-repo — evaluates clean; ~/agents.md symlink created on switch and resolves.

bpmct added 2 commits June 15, 2026 22:08
…rebuild flow

Make the box easier for agents (and humans) to work on after an install:

- programs.git safe.directory whitelists the root-owned /etc/nixos-repo
  so interactive git/nix as the login user no longer trips git's
  dubious-ownership guard (the box's own services already pass
  -c safe.directory inline; this covers ad-hoc use). Harmless on
  appliance ISOs where the repo is a read-only store path.
- A tmpfiles L+ rule symlinks ~/agents.md -> /etc/nixos-repo/agents.md
  in every normal-user home, so an agent landing in $HOME finds the
  guide immediately (the motd only shows on interactive login, not over
  `ssh host 'cmd'`).
- agents.md: document rebuilding via --flake /etc/nixos-repo, the
  /etc/nixos symlink-dir trap, and the harmless dirty-tree warning.

Verified with nixos-rebuild dry-build.
Add the GitHub CLI to systemPackages so working on this repo from the box
(opening PRs, checking CI) doesn't need a separate install. Ships
unauthenticated; the login user runs `gh auth login` once. Note it in
agents.md alongside the git workflow.

Verified with nixos-rebuild dry-build (pulls gh 2.83.2).
@bpmct bpmct requested a review from phorcys420 June 15, 2026 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant