diff options
-rw-r--r-- | nix/sparseTree/default.nix | 12 | ||||
-rw-r--r-- | web/bubblegum/default.nix | 20 |
2 files changed, 20 insertions, 12 deletions
diff --git a/nix/sparseTree/default.nix b/nix/sparseTree/default.nix index 569b9834b305..5184f33d5c46 100644 --- a/nix/sparseTree/default.nix +++ b/nix/sparseTree/default.nix @@ -14,6 +14,9 @@ root: # list of paths below `root` that should be # included in the resulting directory +# +# If path, need to refer to the actual file / directory to be included. +# If a string, it is treated as a string relative to the root. paths: let @@ -40,8 +43,13 @@ let # a leading slash. Additionally some sanity checking is done. makeSymlink = path: let - strPath = toString path; - contextPath = "${path}"; + withLeading = p: if builtins.substring 0 1 p == "/" then p else "/" + p; + fullPath = + /**/ if builtins.isPath path then path + else if builtins.isString path then (root + withLeading path) + else builtins.throw "Unsupported path type ${builtins.typeOf path}"; + strPath = toString fullPath; + contextPath = "${fullPath}"; belowRoot = builtins.substring rootLength (-1) strPath; prefix = builtins.substring 0 rootLength strPath; in assert toString root == prefix; { diff --git a/web/bubblegum/default.nix b/web/bubblegum/default.nix index 2db6f042044b..5ee461456125 100644 --- a/web/bubblegum/default.nix +++ b/web/bubblegum/default.nix @@ -12,20 +12,20 @@ let minimalDepot = sparseTree depot.path [ # general depot things - (depot.path + "/default.nix") - (depot.path + "/nix/readTree") + "default.nix" + "nix/readTree" # nixpkgs for lib and packages - (depot.path + "/third_party/nixpkgs") - (depot.path + "/third_party/overlays") + "third_party/nixpkgs" + "third_party/overlays" # bubblegum and its dependencies - (depot.path + "/web/bubblegum") - (depot.path + "/nix/runExecline") - (depot.path + "/nix/utils") - (depot.path + "/nix/sparseTree") + "web/bubblegum" + "nix/runExecline" + "nix/utils" + "nix/sparseTree" # tvix docs for svg demo - (depot.path + "/tvix/docs") + "tvix/docs" # for blog.nix - (depot.path + "/users/sterni/nix") + "users/sterni/nix" ]; statusCodes = { |