summaryrefslogtreecommitdiff
path: root/sys/core/bootloader.nix
diff options
context:
space:
mode:
authoradikro <adikro@disroot.org>2025-12-20 03:14:45 +0100
committeradikro <adikro@disroot.org>2025-12-20 03:14:45 +0100
commit791bc419b6dac7c70951981ef6b34cdf85828470 (patch)
tree56d0962fdf829ae942feb1344763e54dbc3c89a3 /sys/core/bootloader.nix
parente60410393cea222b16743a1a87f29c06b9b3543b (diff)
absolutely massive rewrite, made (almost) everything modular with changes to come
Diffstat (limited to 'sys/core/bootloader.nix')
-rw-r--r--sys/core/bootloader.nix36
1 files changed, 36 insertions, 0 deletions
diff --git a/sys/core/bootloader.nix b/sys/core/bootloader.nix
new file mode 100644
index 0000000..292679e
--- /dev/null
+++ b/sys/core/bootloader.nix
@@ -0,0 +1,36 @@
+{ config, lib, ... }:
+let
+ cfg = config.szpont.sys.core.bootloader;
+in
+{
+ options.szpont.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;
+ };
+ })
+ ];
+}