From d9df350695d3e07319798b1f169434aee19058c3 Mon Sep 17 00:00:00 2001 From: jammerful Date: Mon, 15 May 2017 23:49:43 -0400 Subject: [PATCH] ssh: Add Newline to KnownHostsText SSH expects a new line at the end of known_hosts file. Without a new line the next entry goes on the same line as the last entry in known_hosts causing errors. --- nixos/modules/programs/ssh.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/programs/ssh.nix b/nixos/modules/programs/ssh.nix index 5f4d4dc9475e..a00fc0dfd19d 100644 --- a/nixos/modules/programs/ssh.nix +++ b/nixos/modules/programs/ssh.nix @@ -20,11 +20,11 @@ let knownHosts = map (h: getAttr h cfg.knownHosts) (attrNames cfg.knownHosts); - knownHostsText = flip (concatMapStringsSep "\n") knownHosts + knownHostsText = (flip (concatMapStringsSep "\n") knownHosts (h: assert h.hostNames != []; concatStringsSep "," h.hostNames + " " + (if h.publicKey != null then h.publicKey else readFile h.publicKeyFile) - ); + )) + "\n"; in {