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

fix: allow for newlines in keys #256

Closed spectre256 closed 5 months ago

spectre256 commented 5 months ago

Previously, empty lines in the keys would be interpreted as a recipient key, leading to the error message age: Error: unknown recipient type: "". This is easy to do if you keep your ssh keys in separate files then add them to secrets.nix using builtins.readFile, since editors like vim will add an invisible newline to the end of every file. (unless you set noeol)

This fixes the issue by ignoring empty lines.

martijnboers commented 5 months ago

@ryantm maybe you can look at this or https://github.com/ryantm/agenix/pull/250 or https://github.com/ryantm/agenix/pull/249?