I want to read a file with a public SSH key,
client_public_key = builtins.readFile ./id_ecdsa.pub;
openssh.authorizedKeys.keys = [ client_public_key ];
for a user. But I cannot login.
If I paste and copy the string in the configuration manually it works OK…
client_public_key = "..I50j\vdMu..";
But, I noticed if I query,
nix-instantiate --eval --strict --attr config.users...openssh.authorizedKeys.keys ./nixos.nix
the returned key has an extra backslash:
Could this be the problem?
readFile escapes the backslash?
Am I doing something silly to cause this? Or missing something obvious?