summaryrefslogtreecommitdiff
path: root/os/core/bootloader.nix
diff options
context:
space:
mode:
authoradikro <adikro@disroot.org>2026-02-10 22:27:11 +0100
committeradikro <adikro@disroot.org>2026-02-10 22:27:11 +0100
commit233e5fb7d43a0736857ee6b9f74967f03b73837c (patch)
treef46c2b13193e495d14502c6b9849482bce366ee3 /os/core/bootloader.nix
parent43f1d9649a8cf9043dee99a3e366534134aba57b (diff)
...
Diffstat (limited to 'os/core/bootloader.nix')
-rw-r--r--os/core/bootloader.nix44
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;