Repository navigation
nixos/artifacts: backend-agnostic secret management interface - #519619
Mutasem-mk4 wants to merge 8 commits into
Conversation
0991e23 to
865b3d5
Compare
This commit updates the backend-agnostic secret management abstraction: - security.artifacts: add 'source' option for encrypted files. - security.artifacts: change 'path' type from path to str to prevent store coercion. - security.artifacts: add rigorous assertions to reject store leaks and missing sources. - security.artifacts/dummy: harden dummy provider against shell injection. - security.artifacts/sops-nix: map 'source' to 'sopsFile'. - security.artifacts/agenix: map 'source' to 'file'. - security.artifacts/systemd-creds: migrate to /etc/credstore convention. - tests/artifacts: expand from 1 to 9 comprehensive integration tests. - doc/manual: expand secret-management.md with architecture and backends.
This patch conditionally translates options into sops.secrets and age.secrets using lib.optionalAttrs, checking whether those external modules are imported via (options ? sops) and (options ? age). This prevents the nixpkgs module evaluator from aborting strictly when testing nixos modules against the dummy provider.
There was a problem hiding this comment.
I don't think anyone was planning on merging this, but I'm blocking this just in case:
This is AI slop. Although NixOS allows LLM-generated contributions into the tree, our automation policy clearly states that LLMs are only to be used as a way to hasten human programming, not do the entirety of the development. We need a capable human in the loop whenever an LLM makes changes, and it's clear from your commits that you are not the one developing this, and neither you nor your AI model really know how to make a working NixOS module. You must also disclose LLM usage whenever it is required by the automation policy, which your commits and PR description fail to do.
Finally, please do not replace the PR description template.
|
Hi @SigmaSquadron, Thanks for the catch and for calling out the policy violation. You're right—I relied too heavily on an LLM to bootstrap this, and I messed up by replacing the PR template and not disclosing it. That's on me, and I apologize. I'm actually very interested in getting this backend-agnostic interface right. I'm going to take a step back, dig into the NixOS module system properly, and rewrite/fix the broken parts myself. I’ll restore and update the PR description template right now to be transparent about the tools used, and I won't ask for another review until I've thoroughly tested everything locally and made sure the implementation is solid. Appreciate your patience and feedback. |
This PR introduces \security.artifacts, a backend-agnostic abstraction layer for managing secrets in NixOS. It decouples NixOS service modules from specific secret providers like sops-nix, agenix, or systemd-creds.
Motivation
Currently, NixOS modules often hardcode support for specific secret managers or leave users to manually pass paths. This forces users into vendor lock-in or fragile configuration.
Implementation
ixosTest\ coverage validating permissions, target ordering, and dummy provisioners.