nixpkgs/pkgs/applications/version-management/gogs/default.nix

32 lines
904 B
Nix
Raw Normal View History

{ stdenv, buildGoPackage, fetchgit, makeWrapper, git, sqliteSupport ? true }:
2016-02-29 04:00:45 +00:00
buildGoPackage rec {
name = "gogs-${version}";
version = "20160728-${stdenv.lib.strings.substring 0 7 rev}";
rev = "ad7ea88923e371df7558835d8f3e0236cfdf69ba";
2016-02-29 04:00:45 +00:00
buildInputs = [ makeWrapper ];
buildFlags = stdenv.lib.optional (sqliteSupport) "-tags sqlite";
2016-02-29 04:00:45 +00:00
goPackagePath = "github.com/gogits/gogs";
outputs = [ "out" "bin" "data" ];
2016-02-29 04:00:45 +00:00
postInstall = ''
mkdir $data
cp -R $src/{public,templates} $data
2016-02-29 04:00:45 +00:00
wrapProgram $bin/bin/gogs \
--prefix PATH : ${git}/bin \
--run 'export GOGS_WORK_DIR=''${GOGS_WORK_DIR:-$PWD}' \
--run 'cd "$GOGS_WORK_DIR"' \
--run "ln -fs $data/{public,templates} ."
2016-02-29 04:00:45 +00:00
'';
src = fetchgit {
inherit rev;
url = "https://github.com/gogits/gogs";
sha256 = "0vgkhpwvj79shpi3bq2sr1nza53fidmnbmh814ic09jnb2dilnrm";
2016-02-29 04:00:45 +00:00
};
goDeps = ./deps.json;
2016-02-29 04:00:45 +00:00
}