Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initrd-ssh: allow empty hostKeys #197382

Merged
merged 1 commit into from
Dec 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion nixos/modules/system/boot/initrd-ssh.nix
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ in
'';
};

ignoreEmptyHostKeys = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc ''
Allow leaving {option}`config.boot.initrd.network.ssh` empty,
to deploy ssh host keys out of band.
'';
};

authorizedKeys = mkOption {
type = types.listOf types.str;
default = config.users.users.root.openssh.authorizedKeys.keys;
Expand Down Expand Up @@ -141,7 +150,7 @@ in
}

{
assertion = cfg.hostKeys != [];
assertion = (cfg.hostKeys != []) || cfg.ignoreEmptyHostKeys;
message = ''
You must now pre-generate the host keys for initrd SSH.
See the boot.initrd.network.ssh.hostKeys documentation
Expand Down