mirror of
https://github.com/aviallon/nixos-lib.git
synced 2026-04-05 17:27:50 +00:00
[Boot] Remove EFI boot auto-detection, demand explicit configuration instead
This commit is contained in:
parent
6bd20a7600
commit
33060cff17
1 changed files with 22 additions and 8 deletions
30
boot.nix
30
boot.nix
|
|
@ -105,10 +105,16 @@ in {
|
|||
|
||||
efi = mkOption rec {
|
||||
description = "Use EFI bootloader";
|
||||
default = builtins.pathExists "/sys/firmware/efi";
|
||||
example = !default;
|
||||
type = types.bool;
|
||||
example = true;
|
||||
type = with types; bool;
|
||||
};
|
||||
legacy = mkOption rec {
|
||||
description = "Use legacy bootloader";
|
||||
default = !cfg.efi;
|
||||
example = true;
|
||||
type = with types; bool;
|
||||
};
|
||||
|
||||
configurationLimit = mkOption {
|
||||
description = "Maximum number of generations in the boot menu";
|
||||
default = 30;
|
||||
|
|
@ -138,11 +144,18 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
boot.kernelParams = toCmdlineList cfg.cmdline;
|
||||
} // (mkIf cfg.enable {
|
||||
boot.kernelParams = toCmdlineList cfg.cmdline;
|
||||
config = mkMerge [
|
||||
{
|
||||
assertions = [
|
||||
{ assertion = cfg.efi -> !cfg.legacy;
|
||||
message = "exactly one of aviallon.boot.efi and aviallon.boot.legacy must be set";
|
||||
}
|
||||
];
|
||||
|
||||
boot.kernelParams = toCmdlineList cfg.cmdline;
|
||||
}
|
||||
(mkIf cfg.enable {
|
||||
|
||||
hardware.enableAllFirmware = allowUnfree;
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
|
||||
|
|
@ -196,5 +209,6 @@ in {
|
|||
efi.canTouchEfiVariables = mkDefault true;
|
||||
};
|
||||
};
|
||||
});
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue