mirror of
https://github.com/nix-community/disko.git
synced 2026-12-02 22:13:28 +01:00
1 parent
b8955c9021
commit
70538c3324
1 file changed
+8
-14
+8
-14
@@ -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 {
|
||||||
|
|||||||
Reference in new issue
Block a user