diff options
Diffstat (limited to 'os/core/bootloader.nix')
| -rw-r--r-- | os/core/bootloader.nix | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/os/core/bootloader.nix b/os/core/bootloader.nix index f0aacc0..52761f1 100644 --- a/os/core/bootloader.nix +++ b/os/core/bootloader.nix @@ -2,12 +2,18 @@ config, lib, ... -}: let +}: +let cfg = config.os.core.bootloader; -in { +in +{ options.os.core.bootloader = { type = lib.mkOption { - type = lib.types.enum ["systemd-boot" "grub" "none"]; + type = lib.types.enum [ + "systemd-boot" + "grub" + "none" + ]; default = "systemd-boot"; description = "which bootloader to use"; }; @@ -35,13 +41,25 @@ in { config = lib.mkMerge [ { boot = { - supportedFilesystems = ["ntfs" "btrfs"]; - kernelParams = ["quiet" "splash"]; - initrd.luks.devices = lib.mkIf (cfg.enableEncryption && cfg.luksDevice != null) { - "crypted" = { - device = cfg.luksDevice; - preLVM = true; - allowDiscards = true; + supportedFilesystems = [ + "ntfs" + "btrfs" + ]; + kernelParams = [ + "quiet" + "splash" + ]; + initrd = { + availableKernelModules = [ + "aesni_intel" + "cryptd" + ]; + luks.devices = lib.mkIf (cfg.enableEncryption && cfg.luksDevice != null) { + "crypted" = { + device = cfg.luksDevice; + preLVM = true; + allowDiscards = true; + }; }; }; }; @@ -57,6 +75,7 @@ in { systemd-boot = { enable = true; editor = false; + consoleMode = "max"; }; }; }; @@ -72,10 +91,7 @@ in { useOSProber = cfg.useOSProber; enableCryptodisk = cfg.enableEncryption; - default = - if cfg.useOSProber - then 2 - else 0; + default = if cfg.useOSProber then 2 else 0; efiSupport = lib.mkDefault (cfg.grubDevice == "nodev"); copyKernels = lib.mkIf cfg.enableEncryption true; |
