Declarative, role-scoped access bundles for the product development estate. Holds encrypted credential material, recipient policy, and Nix modules for developer tooling, CI, and product operations—never personal workstation preferences or plaintext secrets.
  • Nix 69.5%
  • Shell 30.5%
Find a file
2026-10-19 18:49:50 +11:00
modules docs: correct the example repoRoot after the move to ~/.access 2026-09-17 15:06:52 +10:00
roles refactor(access): remove dead Forgejo writer role 2026-09-22 15:23:10 +10:00
scripts chore(hooks): local lint hooks, no CI server (Q16 a) 2026-10-19 18:49:50 +11:00
secrets feat: take the product estate's share of the dotfiles secret split 2026-09-17 14:45:04 +10:00
.gitignore docs(sops): record that the region split is files, not custody 2026-09-17 13:26:34 +10:00
.sops.yaml docs(sops): record that the region split is files, not custody 2026-09-17 13:26:34 +10:00
README.md feat(access): scaffold role-scoped access material for the groupthink-dev region 2026-09-17 11:43:23 +10:00

dev/access

Role-scoped access material for the groupthink-dev (product) trust region, encrypted with sops+age.

Sibling repo: infra/access, same shape, Infra region. The two are deliberately separate repositories rather than two directories in one, so that "which region is this credential in?" is answered by the clone you are standing in.

Trust region — read this before adding anything

This repo is encrypted to the groupthink-dev operator identity only. The personal age key is not a recipient and must not become one: ops-infra ADR-0040 / DD-328 place product signing, notary, provisioning and release material in the gd region precisely so the personal identity cannot read it.

A host without the gd identity in ~/.config/sops/age/keys.txt decrypts nothing here. That is intended. The seam-canary role is the probe that reports it: a host that materialises the infra canary but not this one has an identity gap, not an overlay fault.

If a credential belongs to the Infra region, it goes in infra/access. Do not add a second key group here to make one awkward secret fit.

Why it is not a flake input

The consuming workstation config must evaluate on a host where this checkout does not exist — a fresh machine, or one whose ~/src has been cleared. A flake input would make every build depend on a private clone succeeding, and would put ciphertext in the Nix store for nothing.

So dotfiles is a bootstrap shim: it holds one small credential, clones this repo at activation, evaluates modules/manifest.nix with nix-instantiate, and decrypts the selected roles into its existing managed secret tree. That clone credential is the intentional root of trust, which is exactly why it can never live here.

Layout

.sops.yaml                 encryption policy (gd operator identity only)
modules/role.nix           role/secret schema helpers
modules/manifest.nix       the activation-time contract consumers call
roles/<name>.nix           one role per file
secrets/<name>.yaml        sops-encrypted material backing a role

The contract

nix-instantiate --eval --json --strict modules/manifest.nix \
  --argstr repoRoot "$PWD" \
  --argstr hostName "$(hostname -s)" \
  --argstr roles seam-canary,registry-publisher

Returns the plan: active roles, unknown roles, host-skipped roles, and one entry per output with its sops --extract selector, mode and target name. The manifest resolves which secrets a host should hold; it never decrypts and never sees plaintext. Decryption happens at the consumer, at runtime, as the owning user.

Two rules keep it safe to evaluate anywhere:

  • builtins only. No lib, no nixpkgs, no <nixpkgs> on NIX_PATH — it runs on a degraded host at boot.
  • No secret file reaches the Nix store. Secret files are referenced by repo-relative string, never by a coerced path literal.

Adding a role

  1. Write roles/<name>.nix with the modules/role.nix helpers.
  2. Seed secrets/<name>.yaml:
    cat > secrets/<name>.yaml <<'Y'
    <group>:
        <field>: <value>
    Y
    sops --encrypt --in-place secrets/<name>.yaml
    
    Check grep -c ENC\\[AES256_GCM secrets/<name>.yaml before committing. sops --encrypt --in-place inside secrets/ is the only supported route — encrypting a file elsewhere matches no creation rule and writes nothing.
  3. Select the role on the hosts that need it, in the consumer's per-host config.

Signing and enrolment material is host-gated by name. pack-signer ships with hosts = [ ], so it materialises nowhere until a host is written into that list in a reviewed diff. Keep it that way. hosts = null ("any host that asks") is right for a reader and wrong for anything that signs or joins a fleet.

A role with no secrets file yet

The manifest will plan a role whose secrets/<name>.yaml is not seeded; the consumer reports it unseeded and skips it. This is deliberate — the role is reviewable before the credential exists, and a missing secret fails closed at the consumer instead of half-provisioning.