From 05f4e223b59c03c04bc757d51ce17662bb69f115 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 28 Jun 2024 07:08:57 +0200 Subject: [PATCH] gpt: move boot partitions to the front of disko Than we no longer need to do this in our examples. Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com> --- lib/types/gpt.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/types/gpt.nix b/lib/types/gpt.nix index d66aa48..c9947a0 100644 --- a/lib/types/gpt.nix +++ b/lib/types/gpt.nix @@ -45,7 +45,19 @@ in }; priority = lib.mkOption { type = lib.types.int; - default = if (partition.config.size or "" == "100%") then 9001 else 1000; + default = if partition.config.size or "" == "100%" then + 9001 + else if partition.config.type == "EF02" then + # Boot partition should be created first, because some BIOS implementations require it. + # Priority defaults to 100 here to support any potential use-case for placing partitions prior to EF02 + 100 + else + 1000; + defaultText = '' + 1000: normal partitions + 9001: partitions with 100% size + 100: boot partitions (EF02) + ''; description = "Priority of the partition, smaller values are created first"; }; name = lib.mkOption {