diff --git a/lib/modules/partition/disks.nix b/lib/modules/partition/disks.nix index ba783123..a0dd0947 100644 --- a/lib/modules/partition/disks.nix +++ b/lib/modules/partition/disks.nix @@ -102,7 +102,9 @@ let cleanup = lib.strings.concatLines (builtins.map (partition: "${fdiskCommand "--delete ${diskVar} ${toString partition.index}"} || true") - (builtins.filter (_: !_.keepExisting) partitions)); + (lib.lists.sortOn + (partition: partition.index * -1) + (builtins.filter (_: !_.keepExisting) partitions))); fdiskCommands = lib.strings.concatLines (lib.optionals config.wipe [