Public key is not valid

I’m seeing error: public key is not valid every time I try to do anything, even nix build nixpkgs#hello. I did initially misconfigure my SSH keys when setting up this system, and have since sorted that out. Could someone help me at least get some context here, i.e. what public key Nix is complaining about?

When I pass -v I see that all Nix seems to be doing is fetching some paths, presumably from the main NixOS cache. So is the issue to do with that cache’s public key? I have got it set in my nix.conf.

Yea this sounds like the nix setting trusted-public-keys is malformed. Check /etc/nix/nix.conf and ~/.config/nix/nix.conf or nix config show

Right you are! I must have accidentally trimmed off a couple of characters when I copied in one of my public keys.

Thanks for your help!

Obviously it’s possible to imagine a better error message in this scenario…