nixpkgs/pkgs/servers/mattermost/default.nix
2019-09-19 12:58:13 -07:00

59 lines
1.5 KiB
Nix

{ stdenv, fetchurl, fetchFromGitHub, buildGoPackage, buildEnv }:
let
version = "5.15.0";
mattermost-server = buildGoPackage rec {
pname = "mattermost-server";
inherit version;
src = fetchFromGitHub {
owner = "mattermost";
repo = "mattermost-server";
rev = "v${version}";
sha256 = "1bh53h0bmpc1qmnbpsmwkfrvj66z18m7b1xg7pqikid57ssqxjx9";
};
goPackagePath = "github.com/mattermost/mattermost-server";
buildFlagsArray = ''
-ldflags=
-X ${goPackagePath}/model.BuildNumber=nixpkgs-${version}
'';
};
mattermost-webapp = stdenv.mkDerivation {
pname = "mattermost-webapp";
inherit version;
src = fetchurl {
url = "https://releases.mattermost.com/${version}/mattermost-${version}-linux-amd64.tar.gz";
sha256 = "13xmc2y4pp0b0svzaf4v7ynx6rxcvznx3vqmlrpiil414s69xv45";
};
installPhase = ''
mkdir -p $out
tar --strip 1 --directory $out -xf $src \
mattermost/client \
mattermost/i18n \
mattermost/fonts \
mattermost/templates \
mattermost/config
'';
};
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;
};
}