I just want to say I got the most wonderful error message from a Nix evaluation today:
trace: warning: In file [...]/packet-spot-buildkite-agent/network.nix
a list is being assigned to the option config.programs.ssh.knownHosts.
This will soon be an error as type loaOf is deprecated.
See https://git.io/fj2zm for more information.
Do
programs.ssh.knownHosts =
{ flexo.gsc.io = {...}; }
instead of
programs.ssh.knownHosts =
[ { hostNames = [ "flexo.gsc.io" "r13y.com" "147.75.105.137" ]; ...} ]
This error message:
✔️ is specific: "a list is being assigned to the option config.programs.ssh.knownHosts"
✔️ tells me where to go for more information: https://git.io/fj2zm
✔️ tells me where the violation is: .../packet-spot-buildkite-agent/network.nix
✔️ SHOWS me the code which is wrong:
programs.ssh.knownHosts =
[ { hostNames = [ "flexo.gsc.io" "r13y.com" "147.75.105.137" ]; ...} ]
✔️ AND tells me the solution:
programs.ssh.knownHosts =
{ flexo.gsc.io = {...}; }
This is incredible, and ticks the main three boxes of good errors:
- What is the problem?
- Why did it happen?
- How do I fix it?
Way to go everyone, this is a massive step forward for our community and I am completely floored and delighted. Thank you.
Great warning message indeed! :D
One question though, what would you do if you have multiple hostnames associated with the same publicKey? Would you associate the same key to every hostname entry?