2016-06-10 00:10:40 +02:00
|
|
|
{ stdenv, buildGoPackage, go-bindata, goimports, nix-prefetch-git, git, makeWrapper,
|
|
|
|
fetchFromGitHub }:
|
2016-06-05 16:41:51 +02:00
|
|
|
|
|
|
|
buildGoPackage rec {
|
|
|
|
name = "go2nix-${version}";
|
2017-06-29 09:27:29 +02:00
|
|
|
version = "1.2.1";
|
2016-06-10 00:10:40 +02:00
|
|
|
rev = "v${version}";
|
2016-06-05 16:41:51 +02:00
|
|
|
|
|
|
|
goPackagePath = "github.com/kamilchm/go2nix";
|
|
|
|
|
2016-06-10 00:10:40 +02:00
|
|
|
src = fetchFromGitHub {
|
2016-06-05 16:41:51 +02:00
|
|
|
inherit rev;
|
2016-06-10 00:10:40 +02:00
|
|
|
owner = "kamilchm";
|
|
|
|
repo = "go2nix";
|
2017-06-29 09:27:29 +02:00
|
|
|
sha256 = "0fr9aa50yvchfhv6h6zqblx8ynxk41i2hmv87b344zr2rz6rms72";
|
2016-06-05 16:41:51 +02:00
|
|
|
};
|
|
|
|
|
2016-09-10 12:04:13 +02:00
|
|
|
goDeps = ./deps.nix;
|
2016-06-05 16:41:51 +02:00
|
|
|
|
2017-03-15 16:08:50 +01:00
|
|
|
outputs = [ "bin" "out" "man" ];
|
|
|
|
|
2016-06-05 16:41:51 +02:00
|
|
|
buildInputs = [ go-bindata goimports makeWrapper ];
|
|
|
|
preBuild = ''go generate ./...'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $bin/bin/go2nix \
|
|
|
|
--prefix PATH : ${nix-prefetch-git}/bin \
|
|
|
|
--prefix PATH : ${git}/bin
|
2017-03-15 16:08:50 +01:00
|
|
|
|
|
|
|
mkdir -p $man/share/man/man1
|
|
|
|
cp $src/go2nix.1 $man/share/man/man1
|
2016-06-05 16:41:51 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
allowGoReference = true;
|
2016-09-27 04:25:45 +02:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Go apps packaging for Nix";
|
|
|
|
homepage = https://github.com/kamilchm/go2nix;
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ kamilchm ];
|
|
|
|
};
|
2016-06-05 16:41:51 +02:00
|
|
|
}
|