From 771624767c3d916e2c77d352e71c07bffca8da59 Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Tue, 3 Dec 2024 17:30:42 -0600 Subject: sys/platform/[lustrated]: initial commit, adapted from old [lustrated] repo --- sys/boot/efi.nix | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'sys/boot/efi.nix') diff --git a/sys/boot/efi.nix b/sys/boot/efi.nix index 35cf687..cbcefd9 100644 --- a/sys/boot/efi.nix +++ b/sys/boot/efi.nix @@ -6,8 +6,15 @@ in options.local.boot.efi = { enable = mkEnableOption "EFI with FAT32 system partition"; - esp.uuid = mkOption { - type = types.strMatching "[0-9A-F]{4}-[0-9A-F]{4}"; + esp = { + mountpoint = mkOption { + type = types.enum [ "/boot" "/boot/efi" ]; + default = "/boot"; + }; + + uuid = mkOption { + type = types.strMatching "[0-9A-F]{4}-[0-9A-F]{4}"; + }; }; removable = mkOption { @@ -20,12 +27,16 @@ in initrd.supportedFilesystems = [ "vfat" ]; loader = { - efi.canTouchEfiVariables = !cfg.removable; + efi = { + efiSysMountPoint = cfg.esp.mountpoint; + canTouchEfiVariables = !cfg.removable; + }; + grub.efiInstallAsRemovable = cfg.removable; }; }; - fileSystems."/boot" = { + fileSystems.${cfg.esp.mountpoint} = { device = "/dev/disk/by-uuid/${cfg.esp.uuid}"; fsType = "vfat"; options = [ "noatime" "umask=027" "sync" ]; -- cgit v1.2.3