From 9c4b00f1fbac895cdb73c9b0c1b9f3775d539491 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sat, 22 Jun 2024 20:10:56 +0200 Subject: [PATCH] Allow removing pre-defined partitions --- lib/modules/partition.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/modules/partition.nix b/lib/modules/partition.nix index 1673638a..96f6ede9 100644 --- a/lib/modules/partition.nix +++ b/lib/modules/partition.nix @@ -45,7 +45,7 @@ }; partitions = mkOption { - type = types.attrsOf partitionType; + type = types.attrsOf (types.nullOr partitionType); description = "The partitions of the disk."; default = {}; }; @@ -61,7 +61,7 @@ let partitions = builtins.foldl' (list: predicate: lib.lists.sortOn predicate list) - (builtins.attrValues config.partitions) + (builtins.filter (_: _ != null) (builtins.attrValues config.partitions)) [ (_: _.index) (_: _.order)