mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 15:11:25 +00:00
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) {
|
||||
assertions = [ {
|
||||
assertion = cfg.hostRSAKey != null || cfg.hostDSSKey != null || cfg.hostECDSAKey != null;
|
||||
message = "You should specify at least one host key for initrd SSH";
|
||||
} ];
|
||||
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";
|
||||
}
|
||||
];
|
||||
|
||||
boot.initrd.extraUtilsCommands = ''
|
||||
copy_bin_and_libs ${pkgs.dropbear}/bin/dropbear
|
||||
|
Loading…
Reference in New Issue
Block a user