git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #32268 from volth/patch-74

nixos/initrd-ssh: generate hostkeys if absent

commit4844fbc2677344477c30f0c5fb8bbe4769a20006 authorJörg Thalheim <Mic92@users.noreply.github.com> dateSun 17 Dec 2017, 00:00 (9 years ago) parent0fe9785af6fc78
1 file changed+1−4
nixos/modules/system/boot/initrd-ssh.nix+1−4
nixos/modules/system/boot/initrd-ssh.nix+1−4
@@ -89,9 +89,6 @@ in
8989
9090 config = mkIf (config.boot.initrd.network.enable && cfg.enable) {
9191 assertions = [
92− { assertion = cfg.hostRSAKey != null || cfg.hostDSSKey != null || cfg.hostECDSAKey != null;
93− message = "You should specify at least one host key for initrd SSH";
94− }
9592 { assertion = cfg.authorizedKeys != [];
9693 message = "You should specify at least one authorized key for initrd SSH";
9794 }
@@ -121,7 +118,7 @@ in
121118 echo ${escapeShellArg key} >> /root/.ssh/authorized_keys
122119 '') cfg.authorizedKeys)}
123120
124− dropbear -s -j -k -E -m -p ${toString cfg.port}
121+ dropbear -s -j -k -E -m -p ${toString cfg.port} ${optionalString (cfg.hostRSAKey == null && cfg.hostDSSKey == null && cfg.hostECDSAKey == null) "-R"}
125122 '';
126123
127124 boot.initrd.secrets =