Adopt the *.sops.yaml suffix convention for encrypted files (rename secrets.yaml, retarget nvim rule and tooling) #319
Labels
No labels
bug
enhancement
in-progress
needs-info
needs-triage
p0
ready-for-agent
ready-for-human
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/nixos#319
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Motivation
The nvim sops rule (
utils/modules/development/nvim/config/sops.lua) matches*/secrets.yaml. Name-based matching fails in both directions:secrets.yamlget no decrypt/encrypt handling — e.g.ansible/inventory/host_vars/ipa-cloonar.sops.yaml, and every future per-server ansible secrets file.secrets.yamlin any other project triggers a decrypt error on open, and theBufWriteCmdsave-hook tries to encrypt it — if no creation rule matches, the file cannot be saved from nvim.The fix: the filename itself becomes the contract. Files ending in
.sops.yamlare sops-encrypted; nothing else is touched. The repo already uses this convention on the ansible side.Changes — one atomic PR
secrets.yaml→secrets.sops.yamlviagit mv(preserves history). Ansible keeps its existing<server>.sops.yamlnaming.utils/modules/development/nvim/config/sops.lua): change the pattern to*.sops.yaml, and add a mandatory basename guard skipping files named exactly.sops.yaml— without it the rule would try to decrypt the creation-rules config and, on save, encrypt it..sops.yaml): tighten every[^/]+\.yaml$to[^/]+\.sops\.yaml$. This also stops the root rule from matching the config file itself. Do not touch stale rules for retired hosts (gpd-win4,fw-new,netboot,web-02,ldap-server-arm) — separate cleanup, separate PR.scripts/update-secrets-keys: convention-based discovery —find -name "*.sops.yaml" ! -name ".sops.yaml"— bringing ansible secrets into key rotation and covering future encrypted files with no script edits.sopsFile/defaultSopsFilepaths referencingsecrets.yaml(~23.nixfiles).docs/adr/on origin/main at implementation time) titled roughly "Encrypted files carry the .sops.yaml suffix", recording the marker-suffix contract, both failure modes above, and the config-file exclusion guard. Update CLAUDE.md's mentions ofsecrets.yaml. Historical ADRs 0002/0005/0021 stay untouched — they were accurate when written.Safety / verification
sopsFilepaths are baked by nix, hosts pull the whole tree and rebuild, so rename + reference updates in one commit cannot leave a host pointing at a missing file.scripts/test-configurationmanually)../scripts/update-secrets-keys(sops updatekeys) to verify every renamed file still matches its creation rule.