feat(nixos): add configurationLimit option to systemd-boot
This commit is contained in:
parent
3b5eefe456
commit
32a4144c42
2 changed files with 23 additions and 17 deletions
|
@ -19,6 +19,12 @@ rec {
|
||||||
type = lib.types.attrs;
|
type = lib.types.attrs;
|
||||||
default = { };
|
default = { };
|
||||||
};
|
};
|
||||||
|
mkIntOption =
|
||||||
|
default:
|
||||||
|
lib.mkOption {
|
||||||
|
type = lib.types.int;
|
||||||
|
inherit default;
|
||||||
|
};
|
||||||
mkStrOption = lib.mkOption {
|
mkStrOption = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = "";
|
default = "";
|
||||||
|
|
|
@ -4,27 +4,27 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
inherit (lib.pantheon) mkStrOption;
|
inherit (lib.pantheon) mkIntOption mkStrOption;
|
||||||
cfg = config.machine.bootloader;
|
cfg = config.machine.bootloader;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.machine.bootloader = {
|
options.machine.bootloader = {
|
||||||
type = mkStrOption;
|
type = mkStrOption;
|
||||||
|
configurationLimit = mkIntOption 5;
|
||||||
|
};
|
||||||
|
config.boot = {
|
||||||
|
initrd.availableKernelModules = [
|
||||||
|
"nvme"
|
||||||
|
"xhci_pci"
|
||||||
|
"ahci"
|
||||||
|
"usbhid"
|
||||||
|
"usb_storage"
|
||||||
|
"sd_mod"
|
||||||
|
];
|
||||||
|
loader.efi.canTouchEfiVariables = true;
|
||||||
|
loader.systemd-boot = {
|
||||||
|
enable = cfg.type == "systemd-boot";
|
||||||
|
inherit (cfg) configurationLimit;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
config = lib.mkMerge [
|
|
||||||
{
|
|
||||||
boot.initrd.availableKernelModules = [
|
|
||||||
"nvme"
|
|
||||||
"xhci_pci"
|
|
||||||
"ahci"
|
|
||||||
"usbhid"
|
|
||||||
"usb_storage"
|
|
||||||
"sd_mod"
|
|
||||||
];
|
|
||||||
boot.loader.efi.canTouchEfiVariables = true;
|
|
||||||
}
|
|
||||||
(lib.mkIf (config.machine.bootloader.type == "systemd-boot") {
|
|
||||||
boot.loader.systemd-boot.enable = true;
|
|
||||||
})
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue