aboutsummaryrefslogtreecommitdiffstats
path: root/modules/nixos/sils/bootloader.nix
blob: fc0e0f3f179d012022186fdf7a8e1aa71d66d7d8 (plain) (blame)
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
{
  config,
  lib,
  ...
}: let
  btl = config.sils.bootloader;
in {
  options.sils.bootloader = lib.mkOption {
    type = lib.types.enum ["lanzaboote" "grub"];
    default = "lanzaboote";
    description = "Which bootloader to use.";
  };
  config.boot =
    if btl == "lanzaboote"
    then {
      lanzaboote = {
        enable = true;
        configurationLimit = 10;
        pkiBundle = "/etc/secureboot";
        settings = {
          editor = false;
        };
      };
    }
    else if btl == "grub"
    then {
      loader.grub.enable = true;
    }
    else {};
}