Files
nix-config/modules/boot/loader.nix
T

32 lines
812 B
Nix
Raw Normal View History

2026-08-20 22:03:24 +02:00
{
flake.modules.nixos.loader = {
lib,
config,
...
}:
with lib; let
cfg = config.mySystem.boot;
in {
2026-10-03 09:56:48 +02:00
options.mySystem.boot.systemd-boot = mkOption {
type = types.bool;
default = !cfg.grub.enable;
description = "Does the system use systemd-boot?";
};
options.mySystem.boot.grub = {
enable = mkEnableOption "Does the system use GRUB? (Disables systemd-boot)";
device = mkOption {
type = types.path;
description = "The GRUB device";
2026-08-20 22:03:24 +02:00
};
};
2026-10-03 09:56:48 +02:00
config.boot.loader = {
systemd-boot.enable = cfg.systemd-boot;
efi.canTouchEfiVariables = cfg.systemd-boot;
};
config.boot.loader.grub = mkIf cfg.grub.enable {
inherit (cfg.grub) enable device;
2026-08-20 22:03:24 +02:00
};
};
}