summaryrefslogtreecommitdiff
path: root/modules/nixos/personal/boot.nix
blob: 9486d5ea3c852b61c4fadeb9d65eaf5bd2af7979 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{ config, lib, ... }:

let cfg = config.personal.boot;
in {
  options.personal.boot = {
    grub.enable = lib.mkEnableOption "grub";
    efi.enable = lib.mkEnableOption "EFI";
  };

  config.boot.loader = lib.mkMerge [
    (lib.mkIf cfg.grub.enable {
      grub = {
        enable = true;
        enableCryptodisk = config.boot.initrd.luks.devices != { };
        device = lib.mkDefault "nodev";
      };
    })
    (lib.mkIf cfg.efi.enable {
      efi.canTouchEfiVariables = true;
      grub.efiSupport = true;
    })
  ];
}