ryantm / agenix

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

Unable to pipe string #282

Open fmnxl opened 1 month ago

fmnxl commented 1 month ago

I've been trying to use the pipe feature (https://github.com/ryantm/agenix/pull/154), but I got this error. From my understanding, the piped string should be available as /dev/stdin? Sorry if this is unrelated to agenix itself.

> echo "XXXXXXXXXXXXXXXXXXX" | agenix -e my-secret.age
cp: skipping file '/dev/stdin', as it was replaced while being copied
my-secret.age wasn't created.

Edit: it might be relevant that I'm running this on macOS

fmnxl commented 1 month ago

Ok this seems like a darwin/macOS issue.

echo "XXXX" | cp /dev/stdin /dev/stdout

This outputs the original string on linux, while on darwin it errors with the above message