From e7e5d481a0e15dcd459396e55327749989e04ce0 Mon Sep 17 00:00:00 2001 From: Benjamin Koch Date: Wed, 20 Jan 2021 01:42:58 +0100 Subject: [PATCH 1/3] Add support for "path:./relative/path" --- default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/default.nix b/default.nix index c5d3493..a0a3f1b 100644 --- a/default.nix +++ b/default.nix @@ -39,7 +39,10 @@ let } else { }) else if info.type == "path" then - { outPath = builtins.path { path = info.path; }; + { outPath = builtins.path { + path = if builtins.substring 0 2 info.path == "./" + then src + builtins.substring 1 (-1) info.path + else info.path; }; narHash = info.narHash; } else if info.type == "tarball" then From d1a6788892881f2d15836d0ac1849d844d7b01de Mon Sep 17 00:00:00 2001 From: Benjamin Koch Date: Sun, 24 Jan 2021 01:47:46 +0100 Subject: [PATCH 2/3] Add support for "path:../parent", as well --- default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/default.nix b/default.nix index a0a3f1b..389332d 100644 --- a/default.nix +++ b/default.nix @@ -40,8 +40,8 @@ let }) else if info.type == "path" then { outPath = builtins.path { - path = if builtins.substring 0 2 info.path == "./" - then src + builtins.substring 1 (-1) info.path + path = if builtins.substring 0 1 info.path == "." + then src + ("/" + info.path) else info.path; }; narHash = info.narHash; } From a565cb46bee9fa856a6c15bc9c3bb947fbb784ec Mon Sep 17 00:00:00 2001 From: Benjamin Koch Date: Sun, 24 Jan 2021 05:04:36 +0100 Subject: [PATCH 3/3] Use different method to detect relative paths see https://github.com/edolstra/flake-compat/pull/18 --- default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/default.nix b/default.nix index 389332d..5a9479f 100644 --- a/default.nix +++ b/default.nix @@ -40,7 +40,7 @@ let }) else if info.type == "path" then { outPath = builtins.path { - path = if builtins.substring 0 1 info.path == "." + path = if builtins.substring 0 1 info.path != "/" then src + ("/" + info.path) else info.path; }; narHash = info.narHash;