mirror of
https://github.com/tweag/gomod2nix.git
synced 2024-11-09 12:09:08 +00:00
Parameterise tools.go
Signed-off-by: Martin Baillie <martin@baillie.id>
This commit is contained in:
parent
89cd0675b9
commit
d9ea49c898
2 changed files with 4 additions and 2 deletions
|
@ -161,6 +161,7 @@ let
|
||||||
|
|
||||||
mkGoEnv =
|
mkGoEnv =
|
||||||
{ pwd
|
{ pwd
|
||||||
|
, toolsGo ? pwd + "/tools.go"
|
||||||
}@attrs:
|
}@attrs:
|
||||||
let
|
let
|
||||||
goMod = parseGoMod (readFile "${toString pwd}/go.mod");
|
goMod = parseGoMod (readFile "${toString pwd}/go.mod");
|
||||||
|
@ -201,11 +202,11 @@ let
|
||||||
export GOSUMDB=off
|
export GOSUMDB=off
|
||||||
export GOPROXY=off
|
export GOPROXY=off
|
||||||
|
|
||||||
'' + optionalString (pathExists (pwd + "/tools.go")) ''
|
'' + optionalString (pathExists toolsGo) ''
|
||||||
mkdir source
|
mkdir source
|
||||||
cp ${pwd + "/go.mod"} source/go.mod
|
cp ${pwd + "/go.mod"} source/go.mod
|
||||||
cp ${pwd + "/go.sum"} source/go.sum
|
cp ${pwd + "/go.sum"} source/go.sum
|
||||||
cp ${pwd + "/tools.go"} source/tools.go
|
cp ${toolsGo} source/tools.go
|
||||||
cd source
|
cd source
|
||||||
|
|
||||||
rsync -a -K --ignore-errors ${vendorEnv}/ vendor
|
rsync -a -K --ignore-errors ${vendorEnv}/ vendor
|
||||||
|
|
|
@ -16,5 +16,6 @@ All other arguments are passed verbatim to `stdenv.mkDerivation`.
|
||||||
### mkGoEnv
|
### mkGoEnv
|
||||||
Arguments:
|
Arguments:
|
||||||
- **pwd** Path to working directory.
|
- **pwd** Path to working directory.
|
||||||
|
- **toolsGo** Path to `tools.go` (_default: `pwd + "/tools.go"`).
|
||||||
|
|
||||||
All other arguments are passed verbatim to `stdenv.mkDerivation`.
|
All other arguments are passed verbatim to `stdenv.mkDerivation`.
|
||||||
|
|
Loading…
Reference in a new issue