summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2014-11-27 19:03:41 +0100
committeraszlig <aszlig@redmoonstudios.org>2014-11-27 19:03:41 +0100
commit2249474632c882628eedc52183ff7a3691120e23 (patch)
tree27090e532d062e221491dd8cf27af7ce1b3b6a3a /nixos
parent14f09e01c15591c10bf9a31e4f4b7987b5c6a71b (diff)
downloadnixlib-2249474632c882628eedc52183ff7a3691120e23.tar
nixlib-2249474632c882628eedc52183ff7a3691120e23.tar.gz
nixlib-2249474632c882628eedc52183ff7a3691120e23.tar.bz2
nixlib-2249474632c882628eedc52183ff7a3691120e23.tar.lz
nixlib-2249474632c882628eedc52183ff7a3691120e23.tar.xz
nixlib-2249474632c882628eedc52183ff7a3691120e23.tar.zst
nixlib-2249474632c882628eedc52183ff7a3691120e23.zip
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>
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/networking/ssh/sshd.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/modules/services/networking/ssh/sshd.nix b/nixos/modules/services/networking/ssh/sshd.nix
index d52109b72b5c..4db8d1e25450 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"
     '')}
   '';