initrd-ssh service: check that authorized keys are added
This commit is contained in:
parent
febb35bd03
commit
00f444d0c1
@ -85,10 +85,14 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf (config.boot.initrd.network.enable && cfg.enable) {
|
config = mkIf (config.boot.initrd.network.enable && cfg.enable) {
|
||||||
assertions = [ {
|
assertions = [
|
||||||
assertion = cfg.hostRSAKey != null || cfg.hostDSSKey != null || cfg.hostECDSAKey != null;
|
{ assertion = cfg.hostRSAKey != null || cfg.hostDSSKey != null || cfg.hostECDSAKey != null;
|
||||||
message = "You should specify at least one host key for initrd SSH";
|
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";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
boot.initrd.extraUtilsCommands = ''
|
boot.initrd.extraUtilsCommands = ''
|
||||||
copy_bin_and_libs ${pkgs.dropbear}/bin/dropbear
|
copy_bin_and_libs ${pkgs.dropbear}/bin/dropbear
|
||||||
|
Loading…
x
Reference in New Issue
Block a user