From 6f23f29ba4eb6f7c67e846dacca2d692933bec1f Mon Sep 17 00:00:00 2001 From: Michael Raitza Date: Fri, 19 Feb 2021 09:27:27 +0100 Subject: [PATCH] Add convenience function l.S Takes the same arguments as l.src but returns the necessary /bin/sh code that creates a softlink to src and cd's to the location of the current do script. --- builder.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/builder.nix b/builder.nix index 1b139d6..127d052 100644 --- a/builder.nix +++ b/builder.nix @@ -21,6 +21,13 @@ let __functor = self: arg: resolve arg; src = getSrc root rcwd filter id; inherit pkgs cwd rcwd d1 d2; + # Convenience function that calculates the source tree, links it to src + # and cd's to the location of the current builder. + S = getSrc root rcwd filter (src: + '' + ln -s ${src} src + cd src/${rcwd} + ''); }; _builder = let