From 0693dfe97e2fd9430e9836e18125a281afb9606e Mon Sep 17 00:00:00 2001 From: Yusuf Bera Ertan Date: Sat, 30 Jul 2022 13:53:42 +0300 Subject: [PATCH] fix path --- pkgs-lib.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs-lib.nix b/pkgs-lib.nix index da17bd2..5e639fd 100644 --- a/pkgs-lib.nix +++ b/pkgs-lib.nix @@ -15,8 +15,12 @@ inherit (utils) recursiveAttrPaths concatStringsSep map; inherit (pkgs.lib) mapAttrsRecursive init last getAttrFromPath; + convertToPath = value: + if builtins.isPath value + then value + else pkgs.writeText (concatStringsSep "-" path) value; 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}\""; createFileCmds = map (path: mkCreateFileCmd path (getAttrFromPath path texts)) fileAttrPaths; in