From 02abf4ed0131237c25e0a10db50fa4c41a902a50 Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Sun, 14 Jul 2024 17:53:13 -0600 Subject: sys: final merge of dmz, hv into sys --- sys/boot/chain.nix | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 sys/boot/chain.nix (limited to 'sys/boot/chain.nix') diff --git a/sys/boot/chain.nix b/sys/boot/chain.nix new file mode 100644 index 0000000..c726cf8 --- /dev/null +++ b/sys/boot/chain.nix @@ -0,0 +1,37 @@ +{ config, lib, pkgs, ... }: +with lib; let + cfg = config.local.boot; +in +{ + options.local.boot = { + enable = mkEnableOption "system boot"; + + loader = mkOption { + type = types.enum [ "grub" "systemd-boot" ]; + }; + + kernel = mkOption { + type = types.raw; + }; + }; + + config = mkIf cfg.enable { + boot = { + kernelPackages = cfg.kernel; + + loader = + if cfg.loader == "grub" then { + grub = { + enable = true; + device = "nodev"; + efiSupport = true; + }; + } else { + systemd-boot = { + enable = true; + editor = true; + }; + }; + }; + }; +} -- cgit v1.2.3