{ 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.loader = { systemd-boot.enable = true; systemd-boot.editor = false; timeout = 0; }; }) (lib.mkIf (cfg == "grub") { boot.loader.grub = { enable = true; device = "nodev"; efiSupport = true; useOSProber = true; }; }) ]; }