about summary refs log tree commit diff
path: root/pkgs/development/go-modules/generic/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/go-modules/generic/default.nix')
-rw-r--r--pkgs/development/go-modules/generic/default.nix8
1 files changed, 7 insertions, 1 deletions
diff --git a/pkgs/development/go-modules/generic/default.nix b/pkgs/development/go-modules/generic/default.nix
index 9adebe512471..b3c583da51e4 100644
--- a/pkgs/development/go-modules/generic/default.nix
+++ b/pkgs/development/go-modules/generic/default.nix
@@ -10,6 +10,9 @@
 # A function to override the go-modules derivation
 , overrideModAttrs ? (_oldAttrs : {})
 
+# path to go.mod and go.sum directory
+, modRoot ? "./"
+
 # modSha256 is the sha256 of the vendored dependencies
 , modSha256
 
@@ -58,7 +61,7 @@ let
       export GOCACHE=$TMPDIR/go-cache
       export GOPATH="$TMPDIR/go"
       mkdir -p "''${GOPATH}/pkg/mod/cache/download"
-
+      cd "${modRoot}"
       runHook postConfigure
     '';
 
@@ -98,8 +101,11 @@ let
 
       export GOCACHE=$TMPDIR/go-cache
       export GOPATH="$TMPDIR/go"
+      export GOSUMDB=off
       export GOPROXY=file://${go-modules}
 
+      cd "$modRoot"
+
       runHook postConfigure
     '';