From e60410393cea222b16743a1a87f29c06b9b3543b Mon Sep 17 00:00:00 2001 From: adikro Date: Thu, 18 Dec 2025 21:04:00 +0100 Subject: rewrite of system modules, hm modules are next --- modules/sys/core/bootloader.nix | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 modules/sys/core/bootloader.nix (limited to 'modules/sys/core/bootloader.nix') diff --git a/modules/sys/core/bootloader.nix b/modules/sys/core/bootloader.nix new file mode 100644 index 0000000..dabea20 --- /dev/null +++ b/modules/sys/core/bootloader.nix @@ -0,0 +1,36 @@ +{ config, lib, ... }: +{ + options.szpont.bootloader = lib.mkOption { + type = lib.types.enum [ "systemd-boot" "grub" "none" ]; + description = "which bootloader to use"; + }; + + config = lib.mkMerge [ + { + boot.loader.efi.canTouchEfiVariables = true; + boot.supportedFilesystems = [ "ntfs" ]; + } + + (lib.mkIf (config.szpont.bootloader == "systemd-boot") { + boot = { + kernelParams = [ "quiet" ]; + + loader = { + systemd-boot = { + enable = true; + editor = false; + }; + timeout = 0; + }; + }; + }) + + (lib.mkIf (config.szpont.bootloader == "grub") { + boot.loader.grub = { + enable = true; + device = "nodev"; + efiSupport = true; + }; + }) + ]; +} -- cgit v1.3