diff options
author | volth <volth@webmaster.ms> | 2017-12-03 02:27:29 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-03 02:27:29 +0000 |
commit | af6fc78f5d08e36fa1d5af2ae3ceccd14c59c1a3 (patch) | |
tree | 6a8c4ea8161bf070bdddc54f9953ed9a7fbb6a6d | |
parent | a4336c22901e7bfb07b4fdea7ea81715a81feb04 (diff) | |
download | nixlib-af6fc78f5d08e36fa1d5af2ae3ceccd14c59c1a3.tar nixlib-af6fc78f5d08e36fa1d5af2ae3ceccd14c59c1a3.tar.gz nixlib-af6fc78f5d08e36fa1d5af2ae3ceccd14c59c1a3.tar.bz2 nixlib-af6fc78f5d08e36fa1d5af2ae3ceccd14c59c1a3.tar.lz nixlib-af6fc78f5d08e36fa1d5af2ae3ceccd14c59c1a3.tar.xz nixlib-af6fc78f5d08e36fa1d5af2ae3ceccd14c59c1a3.tar.zst nixlib-af6fc78f5d08e36fa1d5af2ae3ceccd14c59c1a3.zip |
initrd-ssh: generate hostkeys if absent
-rw-r--r-- | nixos/modules/system/boot/initrd-ssh.nix | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/nixos/modules/system/boot/initrd-ssh.nix b/nixos/modules/system/boot/initrd-ssh.nix index d78775c27582..cdeff4845948 100644 --- a/nixos/modules/system/boot/initrd-ssh.nix +++ b/nixos/modules/system/boot/initrd-ssh.nix @@ -89,9 +89,6 @@ in config = mkIf (config.boot.initrd.network.enable && cfg.enable) { assertions = [ - { assertion = cfg.hostRSAKey != null || cfg.hostDSSKey != null || cfg.hostECDSAKey != null; - message = "You should specify at least one host key for initrd SSH"; - } { assertion = cfg.authorizedKeys != []; message = "You should specify at least one authorized key for initrd SSH"; } @@ -121,7 +118,7 @@ in echo ${escapeShellArg key} >> /root/.ssh/authorized_keys '') cfg.authorizedKeys)} - dropbear -s -j -k -E -m -p ${toString cfg.port} + dropbear -s -j -k -E -m -p ${toString cfg.port} ${optionalString (cfg.hostRSAKey == null && cfg.hostDSSKey == null && cfg.hostECDSAKey == null) "-R"} ''; boot.initrd.secrets = |