diff --git a/flake.nix b/flake.nix index 5a55311..f7dfc6d 100644 --- a/flake.nix +++ b/flake.nix @@ -22,11 +22,11 @@ setAttrByStrPath = strPath: value: nixpkgs.lib.setAttrByPath (nixpkgs.lib.strings.splitString "." strPath) value; - homeFilesFromStringAttrs = { dir, attrs, exec ? false }: nixpkgs.lib.mergeAttrsList (map (x: nixpkgs.lib.mergeAttrsList (map (y: { - "${dir}/${x}" = { - text = y; - executable = exec; - }; - }) (builtins.attrValues attrs)) ) (builtins.attrNames attrs)); + homeFilesFromStringAttrs = { dir, attrs, exec ? false }: mergeListsToAttrs (map (x: "${dir}/${x}") (builtins.attrNames attrs)) (map (x: { + text = x; + executable = exec; + }) (builtins.attrValues attrs)); + + mergeListsToAttrs = names: values: nixpkgs.lib.listToAttrs (nixpkgs.lib.zipListsWith (name: value: { inherit name value; }) names values); }; }