From 2249474632c882628eedc52183ff7a3691120e23 Mon Sep 17 00:00:00 2001 From: aszlig Date: Thu, 27 Nov 2014 19:03:41 +0100 Subject: [PATCH] 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 --- nixos/modules/services/networking/ssh/sshd.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/networking/ssh/sshd.nix b/nixos/modules/services/networking/ssh/sshd.nix index d52109b72b5..4db8d1e2545 100644 --- a/nixos/modules/services/networking/ssh/sshd.nix +++ b/nixos/modules/services/networking/ssh/sshd.nix @@ -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" '')} '';