nixos/sshd: Fix build if knownHosts is empty.
Introduced by 77ff279f2767cf1f28eed03a1f93e5df54c99bf5. Build failure: https://headcounter.org/hydra/build/583158/nixlog/5/raw Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
parent
14f09e01c1
commit
2249474632
@ -18,10 +18,10 @@ let
|
||||
knownHosts = map (h: getAttr h cfg.knownHosts) (attrNames cfg.knownHosts);
|
||||
|
||||
knownHostsFile = pkgs.runCommand "ssh_known_hosts" {} ''
|
||||
#!${pkgs.bash}/bin/bash
|
||||
touch "$out"
|
||||
${flip concatMapStrings knownHosts (h: ''
|
||||
pubkeyfile=${builtins.toFile "host.pub" (if h.publicKey == null then readFile h.publicKeyFile else h.publicKey)}
|
||||
${pkgs.gnused}/bin/sed 's/^/${concatStringsSep "," h.hostNames} /' $pubkeyfile >> $out
|
||||
${pkgs.gnused}/bin/sed 's/^/${concatStringsSep "," h.hostNames} /' $pubkeyfile >> "$out"
|
||||
'')}
|
||||
'';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user