From b0950e90f46e2edf1514316857f1a4effed73396 Mon Sep 17 00:00:00 2001 From: colin Date: Fri, 6 Jan 2023 12:44:29 +0000 Subject: [PATCH] persist: prefer mkMerge instead of manually folding attrsets --- modules/persist/computed.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/persist/computed.nix b/modules/persist/computed.nix index ac5dbf11d..7b50749b2 100644 --- a/modules/persist/computed.nix +++ b/modules/persist/computed.nix @@ -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); }