nixpkgs/pkgs/servers/mattermost/default.nix
2017-11-17 21:07:21 -08:00

44 lines
1.1 KiB
Nix

{ stdenv, fetchurl, fetchFromGitHub, buildGoPackage }:
buildGoPackage rec {
name = "mattermost-${version}";
version = "4.4.1";
src = fetchFromGitHub {
owner = "mattermost";
repo = "mattermost-server";
rev = "v${version}";
sha256 = "0imda96wgr2nkkxs2jfcqszx1fqgmbbrh7zqmgjh6ks3an1v4m3c";
};
webApp = fetchurl {
url = "https://releases.mattermost.com/${version}/mattermost-team-${version}-linux-amd64.tar.gz";
sha256 = "1gnzv9xkqawi36z7v9xsy1gk16x71qf0kn8r059qvyarjlyp7888";
};
goPackagePath = "github.com/mattermost/mattermost-server";
buildPhase = ''
runHook preBuild
cd go/src/${goPackagePath}/cmd/platform
go install
runHook postBuild
'';
preInstall = ''
mkdir -p $bin
tar --strip 1 -C $bin -xf $webApp
'';
postInstall = ''
ln -s $bin/bin/platform $bin/bin/mattermost-platform
'';
meta = with stdenv.lib; {
description = "Open-Source, self-hosted Slack-alternative";
homepage = https://www.mattermost.org;
license = with licenses; [ agpl3 asl20 ];
maintainers = with maintainers; [ fpletz ryantm ];
platforms = platforms.unix;
};
}