2021-01-23 12:26:19 +00:00
|
|
|
{ lib, stdenv, buildGoPackage, go-bindata, gotools, nix-prefetch-git, git, makeWrapper,
|
2016-06-09 23:10:40 +01:00
|
|
|
fetchFromGitHub }:
|
2016-06-05 15:41:51 +01:00
|
|
|
|
|
|
|
buildGoPackage rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "go2nix";
|
2018-10-19 15:10:18 +01:00
|
|
|
version = "1.3.0";
|
2016-06-09 23:10:40 +01:00
|
|
|
rev = "v${version}";
|
2016-06-05 15:41:51 +01:00
|
|
|
|
|
|
|
goPackagePath = "github.com/kamilchm/go2nix";
|
|
|
|
|
2016-06-09 23:10:40 +01:00
|
|
|
src = fetchFromGitHub {
|
2016-06-05 15:41:51 +01:00
|
|
|
inherit rev;
|
2016-06-09 23:10:40 +01:00
|
|
|
owner = "kamilchm";
|
|
|
|
repo = "go2nix";
|
2018-10-19 15:10:18 +01:00
|
|
|
sha256 = "1q61mgngvyl2bnmrqahh3bji402n76c7xwv29lwk007gymzgff0n";
|
2016-06-05 15:41:51 +01:00
|
|
|
};
|
|
|
|
|
2016-09-10 11:04:13 +01:00
|
|
|
goDeps = ./deps.nix;
|
2016-06-05 15:41:51 +01:00
|
|
|
|
2020-04-28 02:50:57 +01:00
|
|
|
outputs = [ "out" "man" ];
|
2017-03-15 15:08:50 +00:00
|
|
|
|
2020-03-17 23:22:49 +00:00
|
|
|
nativeBuildInputs = [ go-bindata gotools makeWrapper ];
|
|
|
|
|
2016-06-05 15:41:51 +01:00
|
|
|
preBuild = ''go generate ./...'';
|
|
|
|
|
|
|
|
postInstall = ''
|
2020-04-28 02:50:57 +01:00
|
|
|
wrapProgram $out/bin/go2nix \
|
2016-06-05 15:41:51 +01:00
|
|
|
--prefix PATH : ${nix-prefetch-git}/bin \
|
|
|
|
--prefix PATH : ${git}/bin
|
2017-03-15 15:08:50 +00:00
|
|
|
|
|
|
|
mkdir -p $man/share/man/man1
|
|
|
|
cp $src/go2nix.1 $man/share/man/man1
|
2016-06-05 15:41:51 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
allowGoReference = true;
|
2016-09-27 03:25:45 +01:00
|
|
|
|
2018-04-25 04:20:18 +01:00
|
|
|
doCheck = false; # tries to access the net
|
|
|
|
|
2021-01-23 12:26:19 +00:00
|
|
|
meta = with lib; {
|
2016-09-27 03:25:45 +01:00
|
|
|
description = "Go apps packaging for Nix";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/kamilchm/go2nix";
|
2016-09-27 03:25:45 +01:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ kamilchm ];
|
|
|
|
};
|
2016-06-05 15:41:51 +01:00
|
|
|
}
|