bootloader choice
This commit is contained in:
@@ -89,5 +89,25 @@ in
|
|||||||
settings.PermitRootLogin = allowRootSSH;
|
settings.PermitRootLogin = allowRootSSH;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
boot.loader =
|
||||||
|
if cfg.bootloader == "grub" then
|
||||||
|
{
|
||||||
|
grub = {
|
||||||
|
enable = cfg.grub.enable;
|
||||||
|
device = cfg.grub.device;
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd-boot.enable = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
systemd-boot = {
|
||||||
|
enable = cfg.systemd.enable;
|
||||||
|
efiSupport = cfg.systemd.efiSupport;
|
||||||
|
};
|
||||||
|
|
||||||
|
grub.enable = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,54 @@
|
|||||||
description = "The kernel of the machine";
|
description = "The kernel of the machine";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
bootloader = {
|
||||||
|
type = lib.mkOption {
|
||||||
|
type = lib.types.enum [
|
||||||
|
"grub"
|
||||||
|
"systemd"
|
||||||
|
];
|
||||||
|
default = "grub";
|
||||||
|
description = "Which bootloader to use (grub or systemd-boot)";
|
||||||
|
};
|
||||||
|
|
||||||
|
grub = lib.mkOption {
|
||||||
|
type = lib.types.submodule {
|
||||||
|
options = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
device = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "nodev";
|
||||||
|
description = "Device to install GRUB on";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
default = { };
|
||||||
|
description = "GRUB configuration block";
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd = lib.mkOption {
|
||||||
|
type = lib.types.submodule {
|
||||||
|
options = {
|
||||||
|
enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
efiSupport = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
default = { };
|
||||||
|
description = "systemd-boot configuration block";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
user = {
|
user = {
|
||||||
name = lib.mkOption {
|
name = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
|
|||||||
Reference in New Issue
Block a user