aboutsummaryrefslogtreecommitdiff
path: root/nix/builder/fetch.sh
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2022-07-19 11:56:35 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2022-07-19 11:56:35 +0200
commitc3958801656c7ce0362eeb8cb57f279d5466a2fc (patch)
treeb2213bd457b65e67de9414955737450ef4797a2f /nix/builder/fetch.sh
parent3c846b6a59c1e725b56b7784c30cfbd5a3dc080b (diff)
downloadguichet-c3958801656c7ce0362eeb8cb57f279d5466a2fc.tar.gz
guichet-c3958801656c7ce0362eeb8cb57f279d5466a2fc.zip
Compile with Nix
Diffstat (limited to 'nix/builder/fetch.sh')
-rw-r--r--nix/builder/fetch.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/nix/builder/fetch.sh b/nix/builder/fetch.sh
new file mode 100644
index 0000000..8c6bdb3
--- /dev/null
+++ b/nix/builder/fetch.sh
@@ -0,0 +1,13 @@
+source $stdenv/setup
+
+export HOME=$(mktemp -d)
+
+# Call once first outside of subshell for better error reporting
+go mod download "$goPackagePath@$version"
+
+dir=$(go mod download --json "$goPackagePath@$version" | jq -r .Dir)
+
+chmod -R +w $dir
+find $dir -iname ".ds_store" | xargs -r rm -rf
+
+cp -r $dir $out