1

System: Rename system/modules to system/systemmodules

This commit is contained in:
2026-01-18 15:34:46 +01:00
parent d12b247368
commit 25ae0f4b85
27 changed files with 0 additions and 0 deletions

View File

@ -0,0 +1,51 @@
{
pkgs,
config,
lib,
mylib,
...
}: let
inherit (config.modules) bootloader;
in {
options.modules.bootloader = import ./options.nix {inherit lib mylib;};
config = lib.mkIf bootloader.enable (lib.mkMerge [
{
boot.loader = {
timeout = 10;
efi.canTouchEfiVariables = true;
efi.efiSysMountPoint = bootloader.systemd-boot.bootDevice;
};
}
(lib.mkIf (bootloader.loader == "systemd-boot") {
boot.loader.systemd-boot = {
enable = true;
configurationLimit = 5;
editor = false;
consoleMode = "max";
};
})
(lib.mkIf (bootloader.loader == "grub") {
boot.loader.grub = {
enable = true;
useOSProber = true;
device = bootloader.grub.bootDevice;
};
})
(lib.mkIf (bootloader.loader == "lanzaboote") {
environment.systemPackages = with pkgs; [
sbctl
];
# Lanzaboote replaces systemd-boot
boot.loader.systemd-boot.enable = lib.mkForce false;
boot.lanzaboote = {
enable = true;
# WARN: Make sure to persist this if using impermanence!
pkiBundle = "/var/lib/sbctl";
};
})
]);
}

View File

@ -0,0 +1,32 @@
{
lib,
mylib,
...
}: {
enable = lib.mkEnableOption "Enable boot loader configuration";
loader = lib.mkOption {
type = lib.types.enum [
"grub"
"systemd-boot"
"lanzaboote"
];
description = "What boot loader to use";
example = "systemd-boot";
default = "systemd-boot";
};
systemd-boot.bootDevice = lib.mkOption {
type = lib.types.str;
description = "The path to the boot partition";
example = "/boot/efi";
default = "/boot/efi";
};
grub.bootDevice = lib.mkOption {
type = lib.types.str;
description = "The path to the boot partition";
example = "/dev/sda";
default = "/dev/sda";
};
}