ryantm / agenix

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

Turn module into file path. #242

Open catwith1hat opened 8 months ago

catwith1hat commented 8 months ago

If a module is an attrset deduplicating imports does not work properly and would lead to the module system complaining about redefining options. Here is an example:

error: The option age.identityPaths' in/nix/store/wn50ysifrfp5qj5pp3jqpyvwh8ksz36y-source/machines/foo' is already declared in `/nix/store/wn50ysifrfp5qj5pp3jqpyvwh8ksz36y-source/common/ddclient/default.nix'.

when common/ddclient/default.nix and machines/foo/default.nix is:

{ ..., agenix, ... }: { imports = [ agenix.nixosModules.age ]; }

Turning the module into a filepath fixes the issue.