nixpkgs/pkgs/servers/mattermost/default.nix

57 lines
1.5 KiB
Nix
Raw Normal View History

2018-05-16 17:09:19 +00:00
{ stdenv, fetchurl, fetchFromGitHub, buildGoPackage, buildEnv }:
2016-08-15 01:17:05 +00:00
2018-02-23 17:50:33 +00:00
let
2018-10-19 00:34:43 +00:00
version = "5.4.0";
2018-02-23 17:50:33 +00:00
2018-05-16 17:09:19 +00:00
mattermost-server = buildGoPackage rec {
name = "mattermost-server-${version}";
2016-08-15 01:17:05 +00:00
2018-05-16 17:09:19 +00:00
src = fetchFromGitHub {
owner = "mattermost";
repo = "mattermost-server";
rev = "v${version}";
2018-10-19 00:34:43 +00:00
sha256 = "0sal5ydm1cwnvf3acmiy0400ghhd6v0wj64mkxqwqf8ysnbxizwq";
2018-05-16 17:09:19 +00:00
};
goPackagePath = "github.com/mattermost/mattermost-server";
buildFlagsArray = ''
-ldflags=
-X ${goPackagePath}/model.BuildNumber=nixpkgs-${version}
'';
2016-08-15 01:17:05 +00:00
};
2018-05-16 17:09:19 +00:00
mattermost-webapp = stdenv.mkDerivation {
name = "mattermost-webapp-${version}";
src = fetchurl {
url = "https://releases.mattermost.com/${version}/mattermost-${version}-linux-amd64.tar.gz";
2018-10-19 00:34:43 +00:00
sha256 = "06dg0f6nrh3a2v3lnyn2s39nj5jpsvfkx3ypq4zjpks0srv4mgfz";
2018-05-16 17:09:19 +00:00
};
installPhase = ''
mkdir -p $out
tar --strip 1 --directory $out -xf $src \
mattermost/client \
mattermost/i18n \
mattermost/fonts \
mattermost/templates \
mattermost/config
'';
2016-08-15 01:17:05 +00:00
};
2018-05-16 17:09:19 +00:00
in
buildEnv {
name = "mattermost-${version}";
paths = [ mattermost-server mattermost-webapp ];
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;
};
}