Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use during evaluation? #159

Closed
wmertens opened this issue Feb 20, 2022 · 4 comments
Closed

Use during evaluation? #159

wmertens opened this issue Feb 20, 2022 · 4 comments

Comments

@wmertens
Copy link

Would there be a way to encrypt a file that gets decrypted during nix evaluation? The idea would be to store semi-secrets that change the nix configuration like the contents of /etc/hosts - I'd like to keep that out of git but it's fine in the nix store.

@Mic92
Copy link
Owner

Mic92 commented Feb 21, 2022

No. That's not possible. It would basically involve import-from-derivation and adding secret keys to the nix store at which point you can just have plain text secrets. You maybe want to have a look into https://github.com/vlaci/git-agecrypt or similar if you have this usecase (or wait until nix gets native encryption ....).

@Mic92
Copy link
Owner

Mic92 commented Feb 21, 2022

See https://github.com/Mic92/sops-nix#using-secrets-at-evaluation-time

@wmertens
Copy link
Author

So how would git-agecrypt provide the secret to nix at build time? Is that NixOS/nix#5260 ?

@Mic92
Copy link
Owner

Mic92 commented Feb 22, 2022

Mhm. Right. This won't work with flakes. One could have a flake for secrets in a private repo in plain text. I don't know any other solution.

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

No branches or pull requests

2 participants