fix: handling of multiple luks partitions on same disk

fixes #1263
This commit is contained in:
Maximilian Gaedig committed 2026-07-14 18:15:45 +02:00
1 parent b8955c9021
commit 70538c3324
1 file changed
+8 -14
+8 -14
View File
@@ -342,30 +342,24 @@ in
inherit config options; inherit config options;
default = default =
let let
partMounts = lib.foldr lib.recursiveUpdate { } ( activePartitions = lib.filter (p: p.content != null) (lib.attrValues config.partitions);
map (partition: lib.optionalAttrs (partition.content != null) partition.content._mount) ( mounts = map (p: p.content._mount) activePartitions;
lib.attrValues config.partitions
)
);
in in
{ {
dev = partMounts.dev or ""; dev = lib.concatStringsSep "\n" (map (m: m.dev or "") mounts);
fs = partMounts.fs or { }; fs = lib.foldr lib.recursiveUpdate { } (map (m: m.fs or { }) mounts);
}; };
}; };
_unmount = diskoLib.mkUnmountOption { _unmount = diskoLib.mkUnmountOption {
inherit config options; inherit config options;
default = default =
let let
partMounts = lib.foldr lib.recursiveUpdate { } ( activePartitions = lib.filter (p: p.content != null) (lib.attrValues config.partitions);
map (partition: lib.optionalAttrs (partition.content != null) partition.content._unmount) ( unmounts = map (p: p.content._unmount) activePartitions;
lib.attrValues config.partitions
)
);
in in
{ {
dev = partMounts.dev or ""; dev = lib.concatStringsSep "\n" (map (m: m.dev or "") unmounts);
fs = partMounts.fs or { }; fs = lib.foldr lib.recursiveUpdate { } (map (m: m.fs or { }) unmounts);
}; };
}; };
_config = lib.mkOption { _config = lib.mkOption {