-
Notifications
You must be signed in to change notification settings - Fork 199
Description
I've managed to pare my config down to the following minimal setup:
sops.defaultSopsFile = inputs.self.outPath + "/secrets/secrets.yaml";
sops.age.sshKeyPaths = ["/home/eulalia/.ssh/id_ed25519"];
sops.secrets."passwords/eulalia".neededForUsers = true;Then, in my secrets file (~/flake/secrets/secrets.yaml):
passwords:
eulalia: $y$thisisafakepasswordhashAnd in my sops yaml file (~/.sops.yaml):
keys:
- &eulalia thepublickeytomySSHkeywhenconvertedtoage
creation_rules:
- path_regex: secrets/[^/]+\.(yaml|json|env|ini|sops)$
key_groups:
- age:
- *eulaliaDespite this, when I run sops ~/flake/secrets/secrets.yaml it tells me that it is unable to decrypt:
eulalia@sunlanii:~/flake/ > sops secrets/secrets.yaml
Failed to get the data key required to decrypt the SOPS file.
Group 0: FAILED
thepublickeytomySSHkeywhenconvertedtoage: FAILED
- | failed to load age identities: failed to open file: open
| /home/eulalia/.config/sops/age/keys.txt: no such file or
| directory
The only way to get it to decrypt is to use ssh-to-age to convert my SSH key to an age key and then put it in that location.
Why do I have to put my key there? Isn't setting sops.age.sshKeyPaths enough?
(And yes, I have run sops updatekeys ~/flake/secrets/secrets.yaml a number of times. It has not fixed the issue :p)
I'm presuming that this is the reason behind a related issue I have - namely, when I set my password as described above, it works until I reboot, at which point I'm unable to login. I presume this is because sops is looking for a key file in ~/.config/sops/age/keys.txt despite it not being there.
Thanks!