Skip to content

[MASTER] Terminal home environment as devkit home-manager modules #814

Closed
14 of 14 issues completed
Closed

Description

@c-vigo

Context

The repo already delivers the org toolchain as a dev-shell (mkProjectShell +
nix-direnv), a Nix-built devcontainer image, and thin package-only
homeManagerModules.default / nixosModules.default (#777). What it does not
deliver is the user-environment layer: shell/tmux/sesh/editor/git/~/.claude
configuration with org defaults and per-user overrides — today that exists only
as single-user, hand-maintained personal configuration outside the org.

This epic ports that seed into parameterized homeManagerModules.* (option
namespace vigos.*) shipped from this repo as a second product — its own CI
matrix, docs, and API policy, sharing the devTools SSoT, lockfile, and release
train. Consumers: the org's private NixOS server fleet (HM as NixOS module,
per-user opt-in), and standalone home-manager on personal
machines (aarch64-darwin first-class; x86_64-darwin best-effort). The
devcontainer image is not integrated.

Design authority: docs/rfcs/ADR-home-environment-modules.md (E1 below).

Confirmed decisions (from the ADR)

  • Artifact: home-manager modules with options; homeConfigurations.demo as
    onboarding sugar only. Placement: this repo (parity SSoT; extraction later
    is a URL change).
  • Inputs: home-manager is the only new flake input. No nixvim (editor
    module = programs.neovim + nixpkgs vimPlugins.claudecode-nvim). No
    third-party claude-code flake — keep the fastMovers overlay on
    nixpkgs-unstable, kept fresh by a scheduled lock bump.
  • Image: not integrated (HM activation can't run in dockerTools builds;
    closure/CVE-gate/startup-time costs; container never needs the home env).
  • ~/.claude: ~/.claude.json + settings.local.json never managed;
    settings.json seeded copy-if-absent (seed updates announced in changelog,
    re-seed = delete + re-activate); hooks + an org CLAUDE.md fragment
    (~/.claude/vigos.md) copied via home.activation (checksum-overwrite
    with .bak of local edits) — no symlinks of any kind in .claude/;
    top-level ~/.claude/CLAUDE.md stays user-owned (Claude Code writes to it)
    and is seeded with a single @vigos.md import line; org defaults
    pre-authorize nothing; DISABLE_AUTOUPDATER=1 via home.sessionVariables;
    no home-level skills (repos stay the skills SSoT).
  • CLAUDE.md hierarchy: templates + guidelines, not managed files; optional
    off-by-default symlink option with user-declared paths.
  • Optionality invariant: none → direnv → devcontainer → home env, strictly
    additive; nothing work-required depends on the home env.
  • Platforms: bash and zsh; platform guards
    (pkgs.stdenv.hostPlatform.isLinux, per-package availability);
    aarch64-darwin CI build + Cachix push must exist before first colleague
    onboarding; x86_64-darwin = eval-only best-effort, EOL at nixpkgs 26.05 EOL
    (2026-12-31), fallback = amd64 devcontainer image.
  • Credentials: resident per-user secrets on servers for persistent
    sessions (no SSH agent forwarding); canonical interface
    ~/.config/vigos/secrets/<NAME> (0600) + opt-in shell env export;
    deployment out of scope (sops-nix backing on servers, hand-placed or
    OS-native on laptops); interactive auth must keep working without it.
    Hygiene: scoped/revocable only — fine-grained expiring PATs, Claude
    setup-token, Cachix not per-user; SSH keys (auth + signing) minted per
    user × host, never copied
    — signatures identify the originating machine.
  • Sandboxing: working agreement (autonomous runs in container), not a
    security boundary; bwrap wrapper = tracked backlog, out of scope here.
  • Release: modules ride existing release tags; consumers pin
    github:vig-os/devcontainer/<tag>; option renames get a
    mkRenamedOptionModule shim for one release + changelog modules entry.
    The workspace scaffold's untagged vigos.url gets aligned with the policy
    in E2. Dogfood exception: the maintainer's config tracks dev as
    pre-release canary until the first module-bearing tag ships.
  • One HM mode per user per host (central XOR standalone; never both).

Scope

In:

  • Tracking only — links the sub-issues below; holds decisions + dependency graph.

Out:

  • Image integration (rejected; revisit-trigger in ADR).
  • nixvim editor flake (personal / future).
  • bwrap sandbox wrapper (backlog issue, linked, not in this epic).
  • Server-fleet adoption (private infrastructure repo's change; devkit only
    keeps modules cleanly importable).
  • nix-darwin, macOS Intel investment, home-level skills, atuin sync server.

Sub-issues

Dependency graph & parallelism

  start in parallel:  E1   E2   E3
  E1 ─► A1 ─► A2 ─► A3 ─┐
         └──► A4 ────────┤
                         ├─► B1 ─► B2 ─► B3
  A2 ─────────► C3       │
  A3 + A4 ────────────►  C1 ─► C2
  E1 ─────────► C4   (independent of A/B)
  • Critical path (MVP): E1 → A1 → A2 → A3 → (A4) → B1 → C1.
  • MVP slice (proves the architecture end-to-end): one wave-1 module with
    vigos.* options + matrix checks + darwin CI/Cachix + the maintainer's
    personal configuration consuming it with zero diff + a bootstrap doc the
    arm-Mac colleague follows unaided.
  • Conservative early-exit: stopping after B1 + C1 still delivers a usable,
    documented wave-1 environment on servers and the arm Mac; taking it means
    explicitly re-scoping B2/B3/C4 into follow-up issues so the epic can close
    against its criteria.
  • Sequencing vs. open work: release/0.4.0 is in flight (cutover T4.1 — Publish-cutover to the Nix image (GATED) #639
    still open and gated); the release-branch cut predates all epic code, so epic PRs
    merge to dev freely and ship no earlier than the next release. Library/CI
    tracks are rename-proof and may start now; the C-track doc surge ideally
    lands after the [CHORE] Rename devcontainer → devkit (after publish-cutover #639) #781 rename (or uses org-level URLs); nothing here touches
    T4.1 — Publish-cutover to the Nix image (GATED) #639/T4.4 — Decommission the Debian path #642 (image cutover) — by design.

Acceptance criteria

  • All sub-issues closed; ADR status accepted.
  • nix flake check builds the homeConfigurations matrix; aarch64-darwin CI
    green and its closures on Cachix before first colleague onboarding.
  • The maintainer's personal configuration imports every module landed by this
    epic (no private duplicates); each wave passed the generation-diff bar (no
    package changes; home-files diff within the wave's allowlist).
  • A tier-"none" user is unaffected: dev-shell, devcontainer, CI, pre-commit all
    work with no home-env dependency (optionality invariant holds).
  • Claude Code resolves to the same pinned version via the one fastMovers
    overlay across dev-shell, image, and home modules (store paths differ per
    system); the home modules set DISABLE_AUTOUPDATER via
    home.sessionVariables (dev-shell/image counterpart = linked follow-up
    chore, not this epic).
  • Onboarding test: colleague reaches home-manager switch on the arm Mac with
    zero live help, using C1–C3 alone.

Related existing issues

Issue Relation Verdict
#777 flake polish (module outputs, treefmt, install app) Introduced the package-only homeManagerModules.default/nixosModules.default this epic parameterizes (A1). Extended — cross-link.
#781 rename devcontainer → devkit Namespace vigos.* chosen rename-proof; C-track docs sequence after it where practical. Related — cross-link; no gate.
#546 slim Claude Code OAuth-token forwarding Resolved by the canonical secrets-dir convention: container env-file/mounts ~/.config/vigos/secrets/ (B2). Absorbed — implement via B2, close pointing there.
#779 flake checks as CI Tier 0 (closed via PR #791) A2's matrix checks join the landed Tier-0 gate. Landed substrate — extend.
#795 mkProjectServices helper (closed) Same "second product" flake-growth pattern; no dependency. Independent — precedent landed.
#639 / #642 image cutover / Debian decommission Untouched — image integration rejected by ADR Axis 4. Independent by design.
#545 agent-CLI toolkit (closed) Precedent: agent tooling as product; its host-side counterpart is B2. Historical.
#625 Nix migration master (open, tracking) Structural template for this epic; scope disjoint. Sibling epic.

Refs: #625

Sub-issues

Sub-issues

14 of 14 Issues completed
Loading 14 sub-issues

Activity

  1. added
    feature
    on Jul 4, 2026
  2. 5 remaining items

  3. c-vigo commented on Jul 4, 2026

    @c-vigo
    ContributorAuthor

    MVP night complete — all tracks landed on feature/814-home-environment-modules; full ledger, evidence, and the morning handoff list live in draft PR #833. B2 (#823) / B3 (#824) remain for the follow-up wave.

  4. c-vigo commented on Jul 8, 2026

    @c-vigo
    ContributorAuthor

    Closing — epic complete, all sub-issues closed

    Tracking-only master; acceptance is "all sub-issues closed", now met. Every
    track is done:

    The terminal home environment now ships from vig-os/devcontainer as
    parameterized homeManagerModules.* under the vigos.* namespace, consumed by
    the maintainer's personal config (dogfooded through waves 1–3, #822 evidence
    shows a zero-package-regression switch on the live host).

    Follow-on work (server-fleet adoption, bwrap sandbox wrapper, nix-darwin) is
    out-of-scope per the ADR and tracked separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions