Allow removing pre-defined partitions

This commit is contained in:
Manuel Thalmann 2024-06-22 20:10:56 +02:00
parent 0ffc88451a
commit 9c4b00f1fb

View file

@ -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)