From 233e5fb7d43a0736857ee6b9f74967f03b73837c Mon Sep 17 00:00:00 2001 From: adikro Date: Tue, 10 Feb 2026 22:27:11 +0100 Subject: ... --- os/core/bootloader.nix | 44 ++++++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 14 deletions(-) (limited to 'os/core/bootloader.nix') 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; -- cgit v1.3