flakes
This commit is contained in:
31
modules/base/initrd/default.nix
Normal file
31
modules/base/initrd/default.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options.mj.base.initrd = {
|
||||
enable = lib.mkEnableOption "Enable base initrd settings";
|
||||
|
||||
hostKeys = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
description = "ssh private key for use in initrd.";
|
||||
};
|
||||
|
||||
authorizedKeys = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
description = lib.mdDoc "Authorized keys for the root user on initrd.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.mj.base.initrd.enable {
|
||||
boot.initrd.network = {
|
||||
enable = true;
|
||||
ssh = {
|
||||
enable = true;
|
||||
port = 22;
|
||||
authorizedKeys = config.mj.base.initrd.authorizedKeys;
|
||||
hostKeys = config.mj.base.initrd.hostKeys;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user