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;
|
||||
default = { };
|
||||
};
|
||||
mkIntOption =
|
||||
default:
|
||||
lib.mkOption {
|
||||
type = lib.types.int;
|
||||
inherit default;
|
||||
};
|
||||
mkStrOption = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "";
|
||||
|
|
|
@ -4,16 +4,16 @@
|
|||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib.pantheon) mkStrOption;
|
||||
inherit (lib.pantheon) mkIntOption mkStrOption;
|
||||
cfg = config.machine.bootloader;
|
||||
in
|
||||
{
|
||||
options.machine.bootloader = {
|
||||
type = mkStrOption;
|
||||
configurationLimit = mkIntOption 5;
|
||||
};
|
||||
config = lib.mkMerge [
|
||||
{
|
||||
boot.initrd.availableKernelModules = [
|
||||
config.boot = {
|
||||
initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
"xhci_pci"
|
||||
"ahci"
|
||||
|
@ -21,10 +21,10 @@ in
|
|||
"usb_storage"
|
||||
"sd_mod"
|
||||
];
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
}
|
||||
(lib.mkIf (config.machine.bootloader.type == "systemd-boot") {
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
})
|
||||
];
|
||||
loader.efi.canTouchEfiVariables = true;
|
||||
loader.systemd-boot = {
|
||||
enable = cfg.type == "systemd-boot";
|
||||
inherit (cfg) configurationLimit;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue