mirror of
https://git.mediani.de/mirrors_public/oddlama_nixos-extra-modules.git
synced 2025-10-10 14:10:38 +02:00
38 lines
845 B
Nix
38 lines
845 B
Nix
{
|
|
config,
|
|
lib,
|
|
...
|
|
}: {
|
|
options.boot.mode = lib.mkOption {
|
|
description = "Enable recommended Options for different boot modes";
|
|
type = lib.types.nullOr (lib.types.enum ["bios" "efi" "secureboot"]);
|
|
default = null;
|
|
};
|
|
config.boot.loader = let
|
|
bios-conf = {
|
|
grub = {
|
|
enable = true;
|
|
efiSupport = false;
|
|
configurationLimit = 32;
|
|
};
|
|
};
|
|
efi-conf = {
|
|
# Use the systemd-boot EFI boot loader.
|
|
systemd-boot.enable = true;
|
|
systemd-boot.configurationLimit = 32;
|
|
efi.canTouchEfiVariables = true;
|
|
};
|
|
in
|
|
lib.mkIf (config.boot.mode != null)
|
|
{
|
|
efi = efi-conf;
|
|
bios = bios-conf;
|
|
secureboot = throw "not yet implemented";
|
|
"" = {};
|
|
}
|
|
.${
|
|
if config.boot.mode == null
|
|
then ""
|
|
else config.boot.mode
|
|
};
|
|
}
|