mirror of
https://github.com/tweag/gomod2nix.git
synced 2024-11-09 20:19:08 +00:00
4a59ba5a69
This will make nixpkgs dumps (ie dumping gomod2nix into nixpkgs) easier going forward.
45 lines
1,010 B
Nix
45 lines
1,010 B
Nix
{ version
|
|
, src
|
|
, modules
|
|
}:
|
|
{ stdenv
|
|
, callPackage
|
|
, go
|
|
, lib
|
|
, makeWrapper
|
|
, installShellFiles
|
|
, fetchFromGitHub
|
|
}:
|
|
|
|
let
|
|
builder = callPackage ./builder { };
|
|
|
|
in
|
|
builder.buildGoApplication {
|
|
pname = "gomod2nix";
|
|
inherit version modules src go;
|
|
|
|
allowGoReference = true;
|
|
|
|
subPackages = [ "." ];
|
|
|
|
nativeBuildInputs = [ makeWrapper installShellFiles ];
|
|
|
|
passthru = builder;
|
|
|
|
postInstall = lib.optionalString (stdenv.buildPlatform == stdenv.targetPlatform) ''
|
|
$out/bin/gomod2nix completion bash > gomod2nix.bash
|
|
$out/bin/gomod2nix completion fish > gomod2nix.fish
|
|
$out/bin/gomod2nix completion zsh > _gomod2nix
|
|
installShellCompletion gomod2nix.{bash,fish} _gomod2nix
|
|
'' + ''
|
|
wrapProgram $out/bin/gomod2nix --prefix PATH : ${lib.makeBinPath [ go ]}
|
|
'';
|
|
|
|
meta = {
|
|
description = "Convert applications using Go modules -> Nix";
|
|
homepage = "https://github.com/tweag/gomod2nix";
|
|
license = lib.licenses.mit;
|
|
maintainers = [ lib.maintainers.adisbladis ];
|
|
};
|
|
}
|