nixpkgs/pkgs/servers/mattermost/default.nix

59 lines
1.5 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl, fetchFromGitHub, buildGoPackage, buildEnv }:
2016-08-15 03:17:05 +02:00
2018-02-23 18:50:33 +01:00
let
2020-08-18 12:29:34 +02:00
version = "5.25.3";
2018-02-23 18:50:33 +01:00
2018-05-16 19:09:19 +02:00
mattermost-server = buildGoPackage rec {
2019-08-13 23:52:01 +02:00
pname = "mattermost-server";
inherit version;
2016-08-15 03:17:05 +02:00
2018-05-16 19:09:19 +02:00
src = fetchFromGitHub {
owner = "mattermost";
repo = "mattermost-server";
rev = "v${version}";
2020-08-18 12:29:34 +02:00
sha256 = "03xcwlbb9ff5whsdn2m3kqskxpwpfciikjjndbhksc8k8963z07j";
2018-05-16 19:09:19 +02:00
};
goPackagePath = "github.com/mattermost/mattermost-server";
buildFlagsArray = ''
-ldflags=
-X ${goPackagePath}/model.BuildNumber=nixpkgs-${version}
'';
2016-08-15 03:17:05 +02:00
};
2018-05-16 19:09:19 +02:00
mattermost-webapp = stdenv.mkDerivation {
2019-08-13 23:52:01 +02:00
pname = "mattermost-webapp";
inherit version;
2018-05-16 19:09:19 +02:00
src = fetchurl {
url = "https://releases.mattermost.com/${version}/mattermost-${version}-linux-amd64.tar.gz";
2020-08-18 12:29:34 +02:00
sha256 = "1p1qxzrd6rj1i43vj18ysknrw2v02s7llx94nrdd5lk10ayzmg63";
2018-05-16 19:09:19 +02: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 03:17:05 +02:00
};
2018-05-16 19:09:19 +02:00
in
buildEnv {
name = "mattermost-${version}";
paths = [ mattermost-server mattermost-webapp ];
meta = with lib; {
2018-05-16 19:09:19 +02:00
description = "Open-source, self-hosted Slack-alternative";
homepage = "https://www.mattermost.org";
2018-05-16 19:09:19 +02:00
license = with licenses; [ agpl3 asl20 ];
maintainers = with maintainers; [ fpletz ryantm ];
platforms = platforms.unix;
};
}