diff --git a/builder.nix b/builder.nix index 5d654ad..7e65ffb 100644 --- a/builder.nix +++ b/builder.nix @@ -23,12 +23,16 @@ let then imported.value else { src = filterSource - (path: type: type != "directory" || (baseNameOf path != ".git" && (all (x: path != x) filter))) + (path: type: baseNameOf path != ".git" && baseNameOf path != ".envrc" && (all (x: path != x) filter)) (/. + root); - builder = '' + builder = let + relPath = dirOf (removePrefix (root + "/") builder); + in '' #!/bin/sh set -e pout=$(mktemp -u -p $PWD) + cp -r --reflink=auto --no-preserve=mode "$src/" src + cd src/${relPath} ${/. + builder} $d1 $d2 $out >$pout if [ -e $out -a -s $pout ]; then printf "Error: %s wrote to stdout and created \$3\n" "$d1" >&2