nixpkgs/pkgs/servers/mattermost/default.nix

59 lines
1.5 KiB
Nix
Raw Normal View History

2021-10-18 17:44:57 +02:00
{ lib, stdenv, fetchurl, fetchFromGitHub, buildGoModule, buildEnv }:
2016-08-15 03:17:05 +02:00
2018-02-23 18:50:33 +01:00
let
2021-12-14 19:48:02 +01:00
version = "5.37.5";
2018-02-23 18:50:33 +01:00
2021-10-18 17:44:57 +02:00
mattermost-server = buildGoModule 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";
2021-10-18 17:44:57 +02:00
repo = pname;
2018-05-16 19:09:19 +02:00
rev = "v${version}";
2021-12-14 19:48:02 +01:00
sha256 = "sha256-ddK7gxWl1arCtW2vqmon28AAeyZQPYlbGj3QtOlqtiU=";
2018-05-16 19:09:19 +02:00
};
2021-10-18 17:44:57 +02:00
vendorSha256 = null;
doCheck = false;
2018-05-16 19:09:19 +02:00
2021-08-26 05:31:57 +02:00
ldflags = [
2021-10-18 17:44:57 +02:00
"-s" "-w" "-X github.com/mattermost/mattermost-server/v${lib.versions.major version}/model.BuildNumber=${version}"
2021-08-26 05:31:57 +02:00
];
2018-05-16 19:09:19 +02:00
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";
2021-12-14 19:48:02 +01:00
sha256 = "sha256-G6L8Ct6PtARg2LKxcoFyg9vrDJXIKGByxovquMc6p00=";
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;
};
}