dotfiles/common/boot/default.nix
RingOfStorms (Joshua Bell) 7e7f04574b WIP refactor
2025-03-16 23:25:18 -05:00

35 lines
766 B
Nix

{ config, lib, ... }:
let
ccfg = import ../config.nix;
cfg = config.${ccfg.custom_config_key}.boot;
in
{
imports = [
./grub.nix
./systemd.nix
];
config = {
assertions = [
(
let
enabledBootloaders = lib.filter (x: x.enabled) [
{
name = "systemd";
enabled = cfg.systemd.enable;
}
{
name = "grub";
enabled = cfg.grub.enable;
}
];
in
{
assertion = lib.length enabledBootloaders <= 1;
message =
"Only one bootloader can be enabled at a time. Enabled: "
+ lib.concatStringsSep ", " (map (x: x.name) enabledBootloaders);
}
)
];
};
}