-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathboot.nix
38 lines (38 loc) · 845 Bytes
/
boot.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{
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
};
}