From 6aaa5993e4c1cfb205ed555d958702f9bba1770d Mon Sep 17 00:00:00 2001 From: adikro Date: Wed, 24 Dec 2025 16:21:00 +0100 Subject: a bunch of changes, renames sys to os and refactored some of the logic --- os/core/bootloader.nix | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 os/core/bootloader.nix (limited to 'os/core/bootloader.nix') diff --git a/os/core/bootloader.nix b/os/core/bootloader.nix new file mode 100644 index 0000000..ff0aad5 --- /dev/null +++ b/os/core/bootloader.nix @@ -0,0 +1,42 @@ +{ config, lib, ... }: +let + cfg = config.sys.core.bootloader; +in +{ + options.sys.core.bootloader = lib.mkOption { + type = lib.types.enum [ "systemd-boot" "grub" "none" ]; + default = "systemd-boot"; + description = "which bootloader to use"; + }; + config = lib.mkMerge [ + { + boot.loader.efi.canTouchEfiVariables = true; + boot.supportedFilesystems = [ "ntfs" ]; + boot.kernelParams = [ "quiet" "splash" ]; + } + + (lib.mkIf (cfg == "systemd-boot") { + boot.consoleLogLevel = 0; + boot.loader = { + systemd-boot.enable = true; + systemd-boot.editor = false; + timeout = 0; + }; + }) + + (lib.mkIf (cfg == "grub") { + boot.loader = { + timeout = 3; + efi.efiSysMountPoint = "/boot"; + grub = { + enable = true; + device = "nodev"; + efiSupport = true; + useOSProber = true; + + default = 2; + }; + }; + }) + ]; +} -- cgit v1.3