2022-07-14 12:49:19 +00:00
|
|
|
{ lib
|
2022-07-18 16:21:45 +00:00
|
|
|
, buildGoModule
|
2022-07-14 12:49:19 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchurl
|
|
|
|
, nixosTests
|
|
|
|
}:
|
|
|
|
|
2022-07-18 16:21:45 +00:00
|
|
|
buildGoModule rec {
|
2022-07-14 12:49:19 +00:00
|
|
|
pname = "mattermost";
|
2023-03-08 16:32:21 +00:00
|
|
|
version = "7.8.1";
|
2022-07-14 12:49:19 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mattermost";
|
|
|
|
repo = "mattermost-server";
|
|
|
|
rev = "v${version}";
|
2023-03-08 16:32:21 +00:00
|
|
|
sha256 = "sha256-6aJkJCJmQHvSn5SHIPXj0nNLBuEez9BCYYMMlv3iZqQ=";
|
2022-07-14 12:49:19 +00:00
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
webapp = fetchurl {
|
|
|
|
url = "https://releases.mattermost.com/${version}/mattermost-${version}-linux-amd64.tar.gz";
|
2023-03-08 16:32:21 +00:00
|
|
|
sha256 = "sha256-KmzjhAkv1TpOlHtZnN/ifkQnzDqk1rN+fl4JStZRbXQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-03-08 16:32:21 +00:00
|
|
|
vendorSha256 = "sha256-VvGLYOESyoBpFmIibHWxazliHcscMxf3KcQ46NQ4syk=";
|
2022-01-03 16:56:52 +00:00
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
subPackages = [ "cmd/mattermost" ];
|
2022-01-03 16:56:52 +00:00
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X github.com/mattermost/mattermost-server/v6/model.Version=${version}"
|
2023-01-11 07:51:40 +00:00
|
|
|
"-X github.com/mattermost/mattermost-server/v6/model.BuildNumber=${version}-nixpkgs"
|
|
|
|
"-X github.com/mattermost/mattermost-server/v6/model.BuildDate=1970-01-01"
|
|
|
|
"-X github.com/mattermost/mattermost-server/v6/model.BuildHash=v${version}"
|
|
|
|
"-X github.com/mattermost/mattermost-server/v6/model.BuildHashEnterprise=v${version}"
|
|
|
|
"-X github.com/mattermost/mattermost-server/v6/model.BuildEnterpriseReady=false"
|
2022-07-14 12:49:19 +00:00
|
|
|
];
|
2022-01-03 16:56:52 +00:00
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
postInstall = ''
|
|
|
|
tar --strip 1 --directory $out -xf $webapp \
|
|
|
|
mattermost/{client,i18n,fonts,templates,config}
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
# For some reason a bunch of these files are executable
|
|
|
|
find $out/{client,i18n,fonts,templates,config} -type f -exec chmod -x {} \;
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
passthru.tests.mattermost = nixosTests.mattermost;
|
2022-01-25 03:21:06 +00:00
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Mattermost is an open source platform for secure collaboration across the entire software development lifecycle";
|
|
|
|
homepage = "https://www.mattermost.org";
|
|
|
|
license = with licenses; [ agpl3 asl20 ];
|
2022-08-12 12:06:08 +00:00
|
|
|
maintainers = with maintainers; [ ryantm numinit kranzes ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2022-07-14 12:49:19 +00:00
|
|
|
}
|