summaryrefslogtreecommitdiff
path: root/modules/sys/core/bootloader.nix
blob: dabea200f8a48bc52b6bd7ae74314993a14c75fe (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
36
{ config, lib, ... }:
{
  options.szpont.bootloader = lib.mkOption {
    type = lib.types.enum [ "systemd-boot" "grub" "none" ];
    description = "which bootloader to use";
  };

  config = lib.mkMerge [
    {
      boot.loader.efi.canTouchEfiVariables = true;
      boot.supportedFilesystems = [ "ntfs" ];
    }

    (lib.mkIf (config.szpont.bootloader == "systemd-boot") {
      boot = {
        kernelParams = [ "quiet" ];
        
        loader = {
          systemd-boot = {
            enable = true;
            editor = false;
          };
          timeout = 0;
        };
      };
    })

    (lib.mkIf (config.szpont.bootloader == "grub") {
      boot.loader.grub = {
        enable = true;
        device = "nodev";
        efiSupport = true;
      };
    })
  ];
}