git.iko.soy/typeable/nixpkgs
on master help sign in
initrd-ssh: generate hostkeys if absent
commitaf6fc78f5d08e36fa1d5af2ae3ceccd14c59c1a3 authorvolth <volth@webmaster.ms> dateSun 3 Dec 2017, 02:27 (9 years ago) parenta4336c2
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 =