persist: prefer mkMerge instead of manually folding attrsets

This commit is contained in:
2023-01-06 12:44:29 +00:00
parent d8cd0e1f57
commit b0950e90f4

View File

@@ -25,14 +25,13 @@ let
fixed-dirs = (fixDirs "/home/colin" unfixed-home-dirs) ++ (fixDirs "/" unfixed-sys-dirs);
dirToAttr = dir: {
name = dir.directory;
value = {
dirToAttrs = dir: {
"${dir.directory}" = {
inherit (dir) user group mode store;
};
};
in
{
# compute the `byPath` path => entry mapping from higher-level store => entry mappings.
sane.persist.byPath = builtins.listToAttrs (map dirToAttr fixed-dirs);
sane.persist.byPath = lib.mkMerge (map dirToAttrs fixed-dirs);
}