From bf3755cc2a5bd54400167d41ce9c75751028bc40 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Tue, 26 May 2026 18:29:53 -0400 Subject: refactor bootloaders into modules --- system/bootloader/default.nix | 6 ++++++ system/bootloader/grub.nix | 20 ++++++++++++++++++++ system/bootloader/limine.nix | 24 ++++++++++++++++++++++++ system/default.nix | 1 + 4 files changed, 51 insertions(+) create mode 100644 system/bootloader/default.nix create mode 100644 system/bootloader/grub.nix create mode 100644 system/bootloader/limine.nix (limited to 'system') diff --git a/system/bootloader/default.nix b/system/bootloader/default.nix new file mode 100644 index 0000000..8ff8125 --- /dev/null +++ b/system/bootloader/default.nix @@ -0,0 +1,6 @@ +_: { + imports = [ + ./grub.nix + ./limine.nix + ]; +} diff --git a/system/bootloader/grub.nix b/system/bootloader/grub.nix new file mode 100644 index 0000000..7f1b31a --- /dev/null +++ b/system/bootloader/grub.nix @@ -0,0 +1,20 @@ +{ + lib, + config, + ... +}: let + inherit (lib) mkIf; + cfg = config.bootloader.grub; +in { + config = mkIf cfg.enable { + boot.loader = { + efi.canTouchEfiVariables = true; + grub = { + enable = true; + efiSupport = true; + device = "nodev"; + splashImage = config.theme.wallpaper; + }; + }; + }; +} diff --git a/system/bootloader/limine.nix b/system/bootloader/limine.nix new file mode 100644 index 0000000..3487809 --- /dev/null +++ b/system/bootloader/limine.nix @@ -0,0 +1,24 @@ +{ + lib, + config, + ... +}: let + inherit (lib) mkIf; + cfg = config.bootloader.limine; +in { + config = mkIf cfg.enable { + boot.loader = { + efi.canTouchEfiVariables = true; + limine = { + enable = true; + efiSupport = true; + secureBoot.enable = cfg.secureBoot.enable; + maxGenerations = 10; + style = { + backdrop = config.theme.colors.base; + wallpapers = [config.theme.wallpaper]; + }; + }; + }; + }; +} diff --git a/system/default.nix b/system/default.nix index 17462d8..f8101c8 100644 --- a/system/default.nix +++ b/system/default.nix @@ -13,6 +13,7 @@ in { inputs.nix-gaming.nixosModules.platformOptimizations inputs.nix-gaming.nixosModules.pipewireLowLatency inputs.nix-gaming.nixosModules.wine + ./bootloader ./desktops ./gaming ./virt -- cgit v1.3.1-freya