mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-28 22:32:58 +03:00
nixos/sshd: Fix build if knownHosts is empty.
Introduced by 77ff279f27
.
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