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
|
2023-08-04 22:07:22 +00:00
|
|
|
, fetchpatch
|
2022-07-14 12:49:19 +00:00
|
|
|
, fetchurl
|
|
|
|
, nixosTests
|
|
|
|
}:
|
|
|
|
|
2022-07-18 16:21:45 +00:00
|
|
|
buildGoModule rec {
|
2022-07-14 12:49:19 +00:00
|
|
|
pname = "mattermost";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "8.1.7";
|
2022-07-14 12:49:19 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mattermost";
|
2023-08-04 22:07:22 +00:00
|
|
|
repo = "mattermost";
|
2022-07-14 12:49:19 +00:00
|
|
|
rev = "v${version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-ZpjdJ1Uck0kM+togUKpxRij8V0jQX+12Meks+L1Tc90=";
|
2023-10-09 19:29:22 +00:00
|
|
|
} + "/server";
|
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";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-eORIoZLoxWdvuRlirJ7djBTgueIzlzIhRAoURy58zCA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
vendorHash = "sha256-RPnCAxksKppsjVtZYhwcoJuAmMJ85AstuoBFChKwAOk=";
|
2023-08-04 22:07:22 +00:00
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
subPackages = [ "cmd/mattermost" ];
|
2022-01-03 16:56:52 +00:00
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
tags = [ "production" ];
|
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
2023-10-09 19:29:22 +00:00
|
|
|
"-X github.com/mattermost/mattermost/server/public/model.Version=${version}"
|
|
|
|
"-X github.com/mattermost/mattermost/server/public/model.BuildNumber=${version}-nixpkgs"
|
|
|
|
"-X github.com/mattermost/mattermost/server/public/model.BuildDate=1970-01-01"
|
|
|
|
"-X github.com/mattermost/mattermost/server/public/model.BuildHash=v${version}"
|
2024-01-02 11:29:13 +00:00
|
|
|
"-X github.com/mattermost/mattermost/server/public/model.BuildHashEnterprise=none"
|
2023-10-09 19:29:22 +00:00
|
|
|
"-X github.com/mattermost/mattermost/server/public/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 ];
|
2024-01-02 11:29:13 +00:00
|
|
|
maintainers = with maintainers; [ ryantm numinit kranzes mgdelacroix ];
|
|
|
|
mainProgram = "mattermost";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2022-07-14 12:49:19 +00:00
|
|
|
}
|