- Nix 69.5%
- Shell 30.5%
| modules | ||
| roles | ||
| scripts | ||
| secrets | ||
| .gitignore | ||
| .sops.yaml | ||
| README.md | ||
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>onNIX_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
- Write
roles/<name>.nixwith themodules/role.nixhelpers. - Seed
secrets/<name>.yaml:
Checkcat > secrets/<name>.yaml <<'Y' <group>: <field>: <value> Y sops --encrypt --in-place secrets/<name>.yamlgrep -c ENC\\[AES256_GCM secrets/<name>.yamlbefore committing.sops --encrypt --in-placeinsidesecrets/is the only supported route — encrypting a file elsewhere matches no creation rule and writes nothing. - 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.