Skip to content

feat(home): terminal home environment modules (wave 1) - #833

Merged
c-vigo merged 30 commits into
devfrom
feature/814-home-environment-modules
Jul 4, 2026
Merged

c-vigo merged 30 commits into
devfrom
feature/814-home-environment-modules

Conversation

@c-vigo

@c-vigo c-vigo commented Jul 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Implements the MVP slice of epic #814 — the terminal home environment as devkit home-manager modules, a second product of this flake per the accepted docs/rfcs/ADR-home-environment-modules.md (in this diff). One self-contained master branch; each sub-issue landed via its own worktree branch + PR into it; this draft PR is the CI vehicle and the single human review point.

What this adds, in one paragraph: parameterized vigos.{packages,shell,multiplexer,cli,direnv,git} home-manager modules (path-exported, umbrella default, homeModules alias, programs.vigos-devtools rename shim), the home-manager flake input (the module product's only new input), a ci-{minimal,full} homeConfigurations matrix across four systems built as Tier-0 hm-* checks, a darwin/arm Home Matrix workflow pushing closures to Cachix, the module release/versioning policy, a scheduled nixpkgs-unstable bump workflow, templates.personal + homeConfigurations.demo, and the docs/home/ consumer doc set (bootstrap, cookbook, rollback, credentials, CLAUDE.md templates). The devcontainer image is deliberately untouched (ADR Axis 4); a tier-"none" user is unaffected (optionality invariant).

Ledger

Sub-issue Work PR Status
#815 E1 Accept ADR #829 ✅
#816 E2 Release/versioning policy + scaffold float doc #831 ✅
#817 E3 Scheduled nixpkgs-unstable bump workflow #832 + hotfix #834 ✅
#818 A1 vigos.* namespace + module skeleton + rename shim #835 ✅
#819 A2 home-manager input + ci matrix (Tier-0 hm legs) #835, changelog #841 ✅
#820 A3 Home Matrix workflow (darwin/arm + Cachix) #836 ✅ green on all runs
#821 A4 Wave-1 modules (shell, multiplexer, cli, direnv, git) #837 ✅ TDD
#822 B1 Dogfood evidence c-vigo/vigo-nixos@feature/devkit-wave1-dogfood ✅ evidence + allowlist posted
#825 C1 / #826 C2 Bootstrap + cookbook/rollback/credentials docs #839 ✅
#827 C3 templates.personal + demo #838 ✅
#828 C4 CLAUDE.md templates #840 ✅

Out of scope (follow-up): #823 B2, #824 B3 (waves 2/3).

Evidence

  • Final head CI fully green: image build/tests/integration, Project Checks (Tier-0 incl. new hm-minimal/hm-full legs + 12-test schema suite + downstream stub), dependency review, security scan.
  • Home Matrix green on every run — aarch64-darwin + aarch64-linux module closures on the vig-os Cachix (darwin cache exists before first onboarding, as the ADR requires).
  • Local: pytest tests/test_flake_checks.py 12/12 incl. full nix flake check; warm hm-check build ~7 s (Tier-0 budget safe).
  • Dogfood: personal-config canary builds; categorized diff + acceptance allowlist in B1 — Dogfood wave 1 in the maintainer's personal configuration #822.
  • Caught-by-gates during the run: E3 YAML literal-block break (hotfix fix(ci): yamllint-clean update-nixpkgs-unstable workflow #834), two statix grouped-attr rejections, one ruff-format nit — all fixed pre-merge.

Changelog (what this PR adds under Unreleased)

Added

  • ADR: terminal home environment as devkit home-manager modules (#815)

    • Accepted docs/rfcs/ADR-home-environment-modules.md: parameterized vigos.* home-manager modules as a second product of this repo (epic #814).
  • Home-manager module release/versioning policy (#816)

    • docs/NIX.md: modules ride the existing release train (consumers pin tags), mkRenamedOptionModule deprecation shims, dogfood-canary exception, and the #### Modules changelog sub-heading convention.
    • Workspace scaffold vigos.url float is now documented as deliberate, with the pin recipe.
  • Scheduled nixpkgs-unstable lock bump (#817)

    • Weekly workflow refreshing the fast-movers pin (uv, gh, claude-code) via a chore PR to dev, gated by full CI.
  • vigos. home module set + homeConfigurations matrix* (#818, #819)

    • homeManagerModules.{default,packages,shell,multiplexer,cli,direnv,git} exported as path modules (+ homeModules alias); home-manager flake input (release-26.05, nixpkgs follows); ci-{minimal,full} homeConfigurations across 4 systems built as Tier-0 hm-* checks (x86_64-darwin eval-only).
  • Home Matrix CI workflow (#820)

    • Builds the ci homeConfigurations on aarch64-darwin (macos-latest) and aarch64-linux and pushes closures to Cachix; separate non-required workflow (fail-soft by status).
  • vigos.shell module (#821)

    • Bash + zsh, starship, atuin, zoxide under one enable flag; opt-in secretsEnv hook exporting ~/.config/vigos/secrets/ per the ADR credentials interface.
  • vigos.multiplexer, vigos.cli, vigos.direnv modules (#821)

    • tmux org defaults (vi keys, sane scrollback), modern-unix config (bat/eza/fzf/ripgrep/fd — configuration only, packages stay in vigos.packages), direnv + nix-direnv.
  • vigos.git module (#821)

    • git + delta, gh (ssh protocol), lazygit; identity and per-user-x-host SSH signing are null-default options — nothing is written unless set, so fresh hosts never fail their first commit.
  • templates.personal + homeConfigurations.demo (#827)

    • nix flake init -t github:vig-os/devcontainer#personal scaffolds a personal home-manager flake on the vigos.* modules; demo is the full-profile reference configuration.
  • Home environment docs (#825, #826)

    • docs/home/: bootstrap guide (installer, macOS trusted-users trap, first activation), override cookbook, rollback table, best-effort Intel meaning, credential-hygiene runbook.
  • CLAUDE.md hierarchy templates (#828)

    • docs/home/claude-md/: user-global, workspace-root, and workspace layer templates + the directory-layout convention that makes the cascade work. Guidelines, not enforcement.

Changed

Modules

  • homeManagerModules.default is now the umbrella importing every vigos.* module, each disabled by default (#818); existing imports keep working unchanged.

Deprecated

Modules

  • programs.vigos-devtools.enable → vigos.packages.enable (#818); a mkRenamedOptionModule shim keeps the old option working for one release (docs/NIX.md policy).

Left for the morning

  1. Review, un-draft, merge to dev.
  2. Decide: promote Home Matrix to a required check.
  3. Confirm or reverse the scaffold vigos.url documented-float choice.
  4. Post-merge: workflow_dispatch test of update-nixpkgs-unstable.yml (E3 — Scheduled nixpkgs-unstable lock bump workflow #817).
  5. B1 acceptance: switch on the canary branch, sign off the allowlist, delete private copies (B1 — Dogfood wave 1 in the maintainer's personal configuration #822).
  6. Schedule B2/B2 — Wave 2: vigos.claude + canonical secrets dir into the devcontainer #823 + B3/B3 — Wave 3: vigos.{sesh,ghdash,editor} #824; pick the first module-bearing tag (starts the pin-tags clock).

Refs: #814

c-vigo and others added 13 commits July 4, 2026 17:55
Adds the accepted ADR deciding the terminal home environment product:
parameterized home-manager modules under the vigos.* namespace shipped
from this repo as a second product, home-manager as the only new flake
input, no devcontainer-image integration, the ~/.claude management
policy, platform tiers (aarch64-darwin first-class, x86_64-darwin
best-effort), the resident-credentials convention, and the module
release/versioning policy.

Refs: #815, #814
Lands E1: the accepted ADR (design authority for epic #814).

Refs: #815
…tegory

Records the second-product contract for the vigos.* home-manager
modules: one release train (consumers pin tags), mkRenamedOptionModule
deprecation shims for one release, the dogfood-canary exception, and
the '#### Modules' changelog sub-heading convention. Documents the
workspace scaffold's deliberate vigos.url float with the pin recipe.

Refs: #816
Weekly (+ dispatchable) workflow that refreshes the nixpkgs-unstable
pin feeding the fastMovers overlay (uv, gh, claude-code) and opens a
chore PR to dev with full CI as the merge gate. Implements the ADR
decision to keep claude-code fresh from nixpkgs instead of a
third-party flake.

Refs: #817
The multiline --body string escaped the run literal block, breaking
YAML indentation; build the body with printf instead. Adds the house
truthy disable-line comment on the trigger key. Caught by the
sandbox-pure pre-commit flake check (Tier-0).

Refs: #817
Hotfix for E3 caught by the Tier-0 sandbox pre-commit check.

Refs: #817
Extends the flake schema tests ahead of implementation (TDD red):
required checks gain hm-minimal/hm-full (except x86_64-darwin,
eval-only tier); homeManagerModules must expose the full vigos.*
module set as importable path modules plus the homeModules alias;
homeConfigurations must cover the ci-{minimal,full} x 4-system matrix
and evaluate end to end.

Refs: #819, #818
Relocates the devTools SSoT list to nix/devtools.nix (unchanged
content) so path modules can share it; adds nix/home/ with
vigos.packages (the re-keyed #777 module + mkRenamedOptionModule shim
for programs.vigos-devtools.enable) and enable-option skeletons for
shell/multiplexer/cli/direnv/git behind an imports-only umbrella.
Exports the set as path modules under homeManagerModules.* with the
homeModules alias; extends the deadnix/statix check scope to nix/.

Refs: #818
…ier-0 checks

Adds home-manager (release-26.05, nixpkgs follows) as the module
product's only new input. Builds ci-{minimal,full}-<system>
homeConfigurations from the vigos umbrella with self-pkgs (the same
stable base + fast-mover overlay + allowUnfree as the dev-shell, so
claude-code resolves identically across surfaces) and exposes them as
hm-minimal/hm-full checks on every system except eval-only
x86_64-darwin. Extracts batsWithLibs to nix/bats.nix so the relocated
devTools list and flake.nix share one definition.

Refs: #819
…#835)

Lands A1 (#818) and A2 (#819) for epic #814: vigos.* path-module set
with rename shim and umbrella, devTools relocated to nix/devtools.nix
(SSoT shared with the modules), home-manager input, ci-{minimal,full}
homeConfigurations across 4 systems, hm-minimal/hm-full Tier-0 checks
(x86_64-darwin eval-only). Local evidence: full x86_64-linux Tier-0
green incl. new legs (hm builds: 7s warm); schema pytest 9/9.

Refs: #818, #819
… push

Separate non-required workflow building hm-minimal/hm-full for the
platforms the x86_64-linux Tier-0 gate cannot cover, pushing closures
to the vig-os Cachix so the darwin cache exists before first colleague
onboarding. Fail-soft by non-required status, never continue-on-error;
promotion to required is a follow-up decision.

Refs: #820
c-vigo and others added 15 commits July 4, 2026 18:14
Lands A3 for epic #814. Runs on the draft PR #833 (paths: flake/nix) —
first live run arrives with the next master-branch update.

Refs: #820
Red ahead of #821: the full ci profile must enable bash+zsh, starship,
atuin, zoxide, tmux, direnv(+nix-direnv), git, gh, lazygit; git signing
must stay inactive by default; vigos.shell.secretsEnv must exist and
default off.

Refs: #821
Both shells under one switch so colleagues keep their login shell;
every scalar mkDefault. The opt-in secretsEnv hook exports each
~/.config/vigos/secrets/<NAME> file ([A-Z_][A-Z0-9_]* names, trailing
newline stripped, idempotent via guard variable) from both profile and
rc files, implementing the ADR resident-credentials interface.

Refs: #821
…direnv

tmux with vi keys and org-default ergonomics (all mkDefault,
extraConfig open); modern-unix configuration that never duplicates the
devTools package list; direnv + nix-direnv as the per-project
activation layer.

Refs: #821
git with delta pager, gh on ssh protocol, lazygit. userName/userEmail/
signingKeyPath are null-default options: signing configuration is
written only when a key path is set (per-user x host keys; minting and
forge registration are C2 runbook steps).

Refs: #821
Lands A4 (#821) for epic #814. TDD: red behavior test → shell →
multiplexer/cli/direnv → git. Local evidence: full Tier-0 green (incl.
hm legs), schema pytest 10/10, darwin full-profile eval OK.

Refs: #821
The template scaffolds a personal flake importing the vigos.* modules
(pin-placeholder per the E2 policy); demo is the full-profile
reference homeConfiguration. Template excluded from deadnix/statix
scope like the workspace scaffold.

Refs: #827
Determinate installer, the macOS trusted-users/Cachix trap, template
scaffold, first-activation dotfile-collision path (-b backup), the
one-HM-mode-per-user-per-host rule, uninstall.

Refs: #825
mkDefault/mkForce/extraConfig override patterns; per-surface rollback
table; the operational meaning of best-effort x86_64-darwin; the
resident-credentials interface, per-user x host SSH key policy,
rotation/offboarding runbook, and the honest threat model.

Refs: #826
User-global, workspace-root, and workspace-layer templates exploiting
the root-to-cwd CLAUDE.md cascade, with the directory-layout convention
documented as the assumption that makes the workspace layer work.
Org-level URLs only (rename-agnostic); the optional management option
lands with vigos.claude (#823).

Refs: #828
c-vigo and others added 2 commits July 4, 2026 19:57
…option rename

The #835 flake-API changes (new outputs, renamed option) are the most
consumer-visible part of the epic and were missing from Unreleased;
adds them under Added/Changed/Deprecated using the new Modules
sub-heading convention.

Refs: #819
Changelog completeness for #835 (A1/A2).

Refs: #819
@c-vigo
c-vigo marked this pull request as ready for review July 4, 2026 18:00
@c-vigo
c-vigo enabled auto-merge July 4, 2026 18:00
@c-vigo
c-vigo merged commit 3dc75a8 into dev Jul 4, 2026
15 checks passed
@c-vigo
c-vigo deleted the feature/814-home-environment-modules branch July 4, 2026 18:11
c-vigo added a commit that referenced this pull request Jul 4, 2026
## Summary

Waves 2 and 3 of epic #814, continuing on the same master branch right
after #833 merged. Two module groups complete the `vigos.*` surface:

- **`vigos.claude`** (#823) — the ADR Axis-5 `~/.claude` policy
implemented: `settings.json` seeded copy-if-absent (the seed
pre-authorizes nothing; `includeCoAuthoredBy=false` per the org rule), a
managed `~/.claude/vigos.md` org fragment (checksum-overwrite with
`.bak` of local edits), a single `@vigos.md` import line seeded into the
user-owned `CLAUDE.md` (never overwritten — Claude writes there via the
memory feature), **no symlinks of any kind under `~/.claude/`**,
`DISABLE_AUTOUPDATER` via `home.sessionVariables`, and the
off-by-default workspace-CLAUDE.md management option. The devcontainer
scaffold now mounts `~/.config/vigos/secrets` read-only and exports the
files as env vars at shell startup — **the slim token path #546 asks
for** (compose scaffolding only; the image is untouched per ADR Axis 4).
- **`vigos.sesh` / `vigos.ghdash` / `vigos.editor`** (#824) — the
parameterization-heavy ports: sesh project sessions with the standard
tmux layout as options (`sessions`, `layout.windows` — no hardcoded
paths; picker on tmux `prefix+o`), gh-dash with lean scoped sections
from `repoFilters` (the CPU-tuning lessons as defaults), and neovim with
the `claudecode.nvim` bridge via plain `programs.neovim` (no nixvim
input, per the ADR). The bare devTools neovim went `lowPrio` so a
configured editor wins buildEnv within one profile.

Also in this diff: the wave-1 delta wiring moved to the renamed
`programs.delta.*` options (HM deprecation).

## Ledger

| Sub-issue | Work | PR → master branch | Status |
|---|---|---|---|
| #823 B2 | vigos.claude + container secrets path (absorbs #546) | #844
| ✅ TDD |
| #824 B3 | vigos.sesh, vigos.ghdash, vigos.editor | #845 | ✅ TDD |

## Evidence

- `pytest tests/test_flake_checks.py`: **13/13** (new: claude Axis-5
policy assertions, wave-3 full-profile assertions).
- `nix-fast-build .#checks.x86_64-linux` green incl. `hm-full` with all
nine modules enabled; `ci-full-aarch64-darwin` evaluates.
- Sandbox pre-commit/deadnix/statix checks green (they caught: a statix
grouped-attr rejection, an unused lambda arg, a ruff-format quoting nit,
and the neovim buildEnv collision — all fixed pre-merge).
- Home Matrix re-runs on this PR (paths match) and rebuilds darwin/arm
closures with the full module set.

## Changelog (added under `Unreleased`)

- **vigos.claude module + container secrets path** (#823, absorbs #546)
- `~/.claude` policy per the ADR: seeded settings, managed fragment +
`.bak`, `@vigos.md` import line, `DISABLE_AUTOUPDATER` via
sessionVariables, optional workspace-CLAUDE.md management.
- Devcontainer scaffold mounts `~/.config/vigos/secrets` read-only and
exports the files as env vars — replacing setup-claude.sh forwarding.
- **vigos.sesh, vigos.ghdash, vigos.editor modules** (#824)
- sesh sessions + parameterized standard layout, gh-dash scoped
sections, neovim + claudecode.nvim bridge.

## Follow-ups (not this PR)

- B1 acceptance completion in the personal config (#822), then extending
the dogfood to waves 2/3.
- Home Matrix promotion to required; first module-bearing release tag.

Refs: #814
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