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-04-29 16:46:19 +00:00
|
|
|
version = "7.8.3";
|
2022-07-14 12:49:19 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mattermost";
|
|
|
|
repo = "mattermost-server";
|
|
|
|
rev = "v${version}";
|
2023-04-29 16:46:19 +00:00
|
|
|
hash = "sha256-MJAYKBMQEf82YkDOpLHnL7Jxlz6i0K0B8E99pRxGHgc=";
|
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-04-29 16:46:19 +00:00
|
|
|
hash = "sha256-4VOEDrCKZI5HR5U2m49Dfbs5Mc+i8l4N41jIy8+5D1k=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
vendorHash = "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
|
|
|
}
|