56 lines
1.4 KiB
Nix
56 lines
1.4 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}: let
|
|
inherit (lib.modules) mkForce;
|
|
inherit (lib.modules) mkIf;
|
|
inherit (lib.options) mkEnableOption;
|
|
cfg = config.modules.system.boot;
|
|
in {
|
|
options.modules.system.boot = {
|
|
grub.enable = mkEnableOption "Grub, a bloated boot loader";
|
|
systemd-boot.enable = mkEnableOption "Poetteringboot";
|
|
};
|
|
config = {
|
|
assertions = [
|
|
{
|
|
assertion = cfg.systemd-boot.enable || cfg.grub.enable;
|
|
message = "No bootloader is enabled.";
|
|
}
|
|
{
|
|
assertion = cfg.systemd-boot.enable -> !cfg.grub.enable && cfg.grub.enable -> !cfg.systemd-boot.enable;
|
|
message = "Please enable only ONE of systemd-boot or grub.";
|
|
}
|
|
];
|
|
boot = {
|
|
initrd = {
|
|
verbose = true;
|
|
systemd.enable = true;
|
|
};
|
|
loader = {
|
|
efi.canTouchEfiVariables = true;
|
|
# I love spamming space
|
|
timeout = 0;
|
|
systemd-boot = {
|
|
enable = cfg.systemd-boot.enable;
|
|
editor = mkForce false;
|
|
configurationLimit = 5;
|
|
};
|
|
grub = {
|
|
enable = cfg.grub.enable;
|
|
efiSupport = true;
|
|
device = "nodev";
|
|
configurationLimit = 5;
|
|
};
|
|
};
|
|
plymouth = {
|
|
enable = false;
|
|
# font = "${pkgs.jetbrains-mono}/share/fonts/truetype/JetBrainsMono-Regular.ttf";
|
|
themePackages = [pkgs.plymouth-matrix-theme];
|
|
theme = "matrix";
|
|
};
|
|
};
|
|
};
|
|
}
|