ryantm / agenix

age-encrypted secrets for NixOS and Home manager
https://matrix.to/#/#agenix:nixos.org
Creative Commons Zero v1.0 Universal
1.33k stars 106 forks source link

Agenix cli error in pure evaluation mode #223

Open SamueleFacenda opened 7 months ago

SamueleFacenda commented 7 months ago

I've recently enabled pure evaluation mode in nix.conf. Now when I try to run agenix -e mysecret.age I get an error that states that access to absolute path '/nixos-config/secrets/secrets.nix' is forbidden in pure eval mode (use '--impure' to override) and I cannot proceed. I don't know if this is intended (keeping the evaluation pure), but the fix would be to add the --impure flag to nix-instantiate in agenix.sh. Personally I think that this would not have drawbacks, reading from a file is an impure operation and thus should be marked as such.