Mic92 / sops-nix

Atomic secret provisioning for NixOS based on sops
MIT License
1.67k stars 156 forks source link

Templates with file option #583

Open RaHoni opened 5 months ago

RaHoni commented 5 months ago

sops.template."dir.conf".file = ./bacula-dir.conf does not work as expected.

The reason seems to be that when I try to use ${config.sops.placeholder.bacula-dbpass} like in content it does not get replaced by the right string. Is there an easy way to fix this or is this by design?

If it is by design how are you supposed to do it?

For further reference see https://github.com/RaHoni/nixos-conf/blob/54b6cf2a49c01a256e359eaa1a0a7654375113fb/bacula/dir.nix#L23

mihakrumpestar commented 2 months ago

I just encountered this myself, were you able to get it working @RaHoni ?

RaHoni commented 2 months ago

I fixed it with a function that replaces placeholders with the correct ones.

You can see my example at my dir.nix