fix path
This commit is contained in:
parent
9d7c3a3c92
commit
0693dfe97e
@ -15,8 +15,12 @@
|
|||||||
inherit (utils) recursiveAttrPaths concatStringsSep map;
|
inherit (utils) recursiveAttrPaths concatStringsSep map;
|
||||||
inherit (pkgs.lib) mapAttrsRecursive init last getAttrFromPath;
|
inherit (pkgs.lib) mapAttrsRecursive init last getAttrFromPath;
|
||||||
|
|
||||||
|
convertToPath = value:
|
||||||
|
if builtins.isPath value
|
||||||
|
then value
|
||||||
|
else pkgs.writeText (concatStringsSep "-" path) value;
|
||||||
fileAttrPaths = recursiveAttrPaths site;
|
fileAttrPaths = recursiveAttrPaths site;
|
||||||
texts = mapAttrsRecursive (path: value: pkgs.writeText (concatStringsSep "-" path) value) site;
|
texts = mapAttrsRecursive (path: value: convertToPath value) site;
|
||||||
mkCreateFileCmd = path: value: let p = concatStringsSep "/" (init path); in "mkdir -p \"$out/${p}\" && ln -s \"${value}\" \"$out/${p}/${last path}\"";
|
mkCreateFileCmd = path: value: let p = concatStringsSep "/" (init path); in "mkdir -p \"$out/${p}\" && ln -s \"${value}\" \"$out/${p}/${last path}\"";
|
||||||
createFileCmds = map (path: mkCreateFileCmd path (getAttrFromPath path texts)) fileAttrPaths;
|
createFileCmds = map (path: mkCreateFileCmd path (getAttrFromPath path texts)) fileAttrPaths;
|
||||||
in
|
in
|
||||||
|
Loading…
Reference in New Issue
Block a user