blob: 7293ffcaa0484012d38e7774291438a8c8e1fdcc (
plain)
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
|
{ config, lib, ... }:
let
cfg = config.sys.core.bootloader;
in
{
options.sys.core.bootloader = lib.mkOption {
type = lib.types.enum [ "systemd-boot" "grub" "none" ];
default = "systemd-boot";
description = "which bootloader to use";
};
config = lib.mkMerge [
{
boot.loader.efi.canTouchEfiVariables = true;
boot.supportedFilesystems = [ "ntfs" ];
boot.kernelParams = [ "quiet" "splash" ];
}
(lib.mkIf (cfg == "systemd-boot") {
boot.loader = {
systemd-boot.enable = true;
systemd-boot.editor = false;
timeout = 0;
};
})
(lib.mkIf (cfg == "grub") {
boot.loader.grub = {
enable = true;
device = "nodev";
efiSupport = true;
useOSProber = true;
};
})
];
}
|