mirror of
https://github.com/tweag/gomod2nix.git
synced 2024-11-09 12:09:08 +00:00
Merge pull request #80 from adisbladis/more-pr-notes
Implement more suggestions from nixpkgs #188035
This commit is contained in:
commit
a54ee7973a
2 changed files with 13 additions and 10 deletions
|
@ -172,6 +172,8 @@ let
|
||||||
dontConfigure = true;
|
dontConfigure = true;
|
||||||
dontInstall = true;
|
dontInstall = true;
|
||||||
|
|
||||||
|
CGO_ENABLED = attrs.CGO_ENABLED or go.CGO_ENABLED;
|
||||||
|
|
||||||
propagatedBuildInputs = [ go ];
|
propagatedBuildInputs = [ go ];
|
||||||
|
|
||||||
GO_NO_VENDOR_CHECKS = "1";
|
GO_NO_VENDOR_CHECKS = "1";
|
||||||
|
@ -253,6 +255,7 @@ let
|
||||||
inherit (go) GOOS GOARCH;
|
inherit (go) GOOS GOARCH;
|
||||||
|
|
||||||
GO_NO_VENDOR_CHECKS = "1";
|
GO_NO_VENDOR_CHECKS = "1";
|
||||||
|
CGO_ENABLED = attrs.CGO_ENABLED or go.CGO_ENABLED;
|
||||||
|
|
||||||
GO111MODULE = "on";
|
GO111MODULE = "on";
|
||||||
GOFLAGS = [ "-mod=vendor" ] ++ lib.optionals (!allowGoReference) [ "-trimpath" ];
|
GOFLAGS = [ "-mod=vendor" ] ++ lib.optionals (!allowGoReference) [ "-trimpath" ];
|
||||||
|
|
20
generic.nix
20
generic.nix
|
@ -9,13 +9,11 @@
|
||||||
, makeWrapper
|
, makeWrapper
|
||||||
, installShellFiles
|
, installShellFiles
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
|
, buildGoApplication ? (callPackage ./builder { }).buildGoApplication
|
||||||
|
, mkGoEnv ? (callPackage ./builder { }).buildGoApplication
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
buildGoApplication {
|
||||||
builder = callPackage ./builder { };
|
|
||||||
|
|
||||||
in
|
|
||||||
builder.buildGoApplication {
|
|
||||||
pname = "gomod2nix";
|
pname = "gomod2nix";
|
||||||
inherit version modules src go;
|
inherit version modules src go;
|
||||||
|
|
||||||
|
@ -25,13 +23,15 @@ builder.buildGoApplication {
|
||||||
|
|
||||||
nativeBuildInputs = [ makeWrapper installShellFiles ];
|
nativeBuildInputs = [ makeWrapper installShellFiles ];
|
||||||
|
|
||||||
passthru = builder;
|
passthru = {
|
||||||
|
inherit buildGoApplication mkGoEnv;
|
||||||
|
};
|
||||||
|
|
||||||
postInstall = lib.optionalString (stdenv.buildPlatform == stdenv.targetPlatform) ''
|
postInstall = lib.optionalString (stdenv.buildPlatform == stdenv.targetPlatform) ''
|
||||||
$out/bin/gomod2nix completion bash > gomod2nix.bash
|
installShellCompletion --cmd gomod2nix \
|
||||||
$out/bin/gomod2nix completion fish > gomod2nix.fish
|
--bash <($out/bin/gomod2nix completion bash) \
|
||||||
$out/bin/gomod2nix completion zsh > _gomod2nix
|
--fish <($out/bin/gomod2nix completion fish) \
|
||||||
installShellCompletion gomod2nix.{bash,fish} _gomod2nix
|
--zsh <($out/bin/gomod2nix completion zsh)
|
||||||
'' + ''
|
'' + ''
|
||||||
wrapProgram $out/bin/gomod2nix --prefix PATH : ${lib.makeBinPath [ go ]}
|
wrapProgram $out/bin/gomod2nix --prefix PATH : ${lib.makeBinPath [ go ]}
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in a new issue