initrd-ssh service: add assertions for host keys
commit53b88524989e51c3b3da87dfa1ee8b95c32467f7
authorNikolay Amiantov <ab@fmap.me>
dateFri 20 May 2016, 16:34 (11 years ago)
parentba718a9
nixos/modules/system/boot/initrd-ssh.nix+4
@@ -85,6 +85,10 @@ in
8585 };
8686
8787 config = mkIf (config.boot.initrd.network.enable && cfg.enable) {
88+ assertions = [ {
89+ assertion = cfg.hostRSAKey != null || cfg.hostDSSKey != null || cfg.hostECDSAKey != null;
90+ message = "You should specify at least one host key for initrd SSH";
91+ } ];
8892
8993 boot.initrd.extraUtilsCommands = ''
9094 copy_bin_and_libs ${pkgs.dropbear}/bin/dropbear