mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-06 01:38:06 +00:00
[Boot] Add a configurationLimit option to limit the maximum number of boot configuration
This commit is contained in:
parent
44ba32bab0
commit
698884fc58
1 changed files with 17 additions and 2 deletions
19
boot.nix
19
boot.nix
|
|
@ -23,6 +23,7 @@ let
|
|||
};
|
||||
};
|
||||
cfg = config.aviallon.boot;
|
||||
generalCfg = config.aviallon.general;
|
||||
allowUnfree = (types.isType types.attrs config.nixpkgs.config)
|
||||
&& (hasAttr "allowUnfree" config.nixpkgs.config)
|
||||
&& (getAttr "allowUnfree" config.nixpkgs.config);
|
||||
|
|
@ -51,6 +52,12 @@ in
|
|||
example = !default;
|
||||
type = types.bool;
|
||||
};
|
||||
configurationLimit = mkOption {
|
||||
description = "Maximum number of generations in the boot menu";
|
||||
default = 30;
|
||||
example = null;
|
||||
type = types.int;
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
|
@ -74,10 +81,18 @@ in
|
|||
loader.grub = {
|
||||
version = 2;
|
||||
device = (if cfg.efi then "nodev" else null);
|
||||
efiSupport = true;
|
||||
efiSupport = cfg.efi;
|
||||
configurationLimit = cfg.configurationLimit;
|
||||
};
|
||||
|
||||
loader.systemd-boot.enable = cfg.efi && (!cfg.useGrub);
|
||||
loader.systemd-boot = {
|
||||
enable = cfg.efi && (!cfg.useGrub);
|
||||
configurationLimit = cfg.configurationLimit;
|
||||
};
|
||||
|
||||
loader.generic-extlinux-compatible = {
|
||||
configurationLimit = cfg.configurationLimit;
|
||||
};
|
||||
|
||||
loader = {
|
||||
efi.efiSysMountPoint = mkDefault "/boot/efi";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue