Skip to content

Add args option for age key generation - #942

Open
LucasWagler wants to merge 4 commits into
Mic92:masterfrom
LucasWagler:feature/add-age-key-gen-args
Open

Add args option for age key generation#942
LucasWagler wants to merge 4 commits into
Mic92:masterfrom
LucasWagler:feature/add-age-key-gen-args

Conversation

@LucasWagler

@LucasWagler LucasWagler commented Apr 8, 2026

Copy link
Copy Markdown

Add a flexible sops.age.extraGenerateKeyArgs option to the base/NixOS, home-manager, and darwin modules.

This enables:

  • Post-quantum key generation: age-keygen currently offers option -pq for this. This is the primary driver behind the PR.
  • Future flexibility: If age-keygen adds more options in the future, sops-nix users can use this escape hatch without waiting for new development.

💬 Seeking Feedback: Option Naming

Here are some options I'm considering:

  • Rename generateKey to keyGeneration.enable & add keyGeneration.extraArgs
    • 👍 Explicitly groups the two options together
    • 👎 keyFile option is left out, despite also being relevant. keyFile impacts key generation, but also has a purpose outside of generation.
  • extraGenerateKeyArgs
    • 👍 Non-invasive. No end user refactoring to get rid of rename warning.
    • 👍 All three options impacting key generation stay at the same nesting level
    • 👎 Implicit grouping, not explicit
    • 👎 Long/wordy

I like the first option better, but the second option is what is currently implemented. Let me know your thoughts!

@LucasWagler
LucasWagler force-pushed the feature/add-age-key-gen-args branch from 6139ced to da91d27 Compare April 8, 2026 21:39
Comment thread modules/home-manager/sops.nix Outdated
@LucasWagler
LucasWagler force-pushed the feature/add-age-key-gen-args branch from da91d27 to e1b7f5b Compare April 10, 2026 19:14
Comment thread modules/home-manager/sops.nix Outdated
Comment thread modules/nix-darwin/default.nix Outdated
Comment thread modules/sops/default.nix Outdated
@LucasWagler
LucasWagler force-pushed the feature/add-age-key-gen-args branch from e1b7f5b to 46255b9 Compare April 14, 2026 13:01
@LucasWagler
LucasWagler force-pushed the feature/add-age-key-gen-args branch from 46255b9 to 21000a6 Compare April 25, 2026 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants