nixpkgs/pkgs/servers/mattermost/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

68 lines
2.1 KiB
Nix
Raw Normal View History

2022-06-20 23:24:30 +00:00
{ lib
, buildGoModule
2022-06-20 23:24:30 +00:00
, fetchFromGitHub
, fetchpatch
2022-06-20 23:24:30 +00:00
, fetchurl
, nixosTests
}:
buildGoModule rec {
2022-06-20 23:24:30 +00:00
pname = "mattermost";
version = "8.1.10";
2022-06-20 23:24:30 +00:00
src = fetchFromGitHub {
owner = "mattermost";
repo = "mattermost";
2022-06-20 23:24:30 +00:00
rev = "v${version}";
hash = "sha256-eloO83koCNZOR/NYzUCdKOtVdF7rk+VrZ9U2bKWkxNU=";
} + "/server";
2018-05-16 17:09:19 +00:00
# this can probably be removed again in versions newer than 8.1.10
overrideModAttrs = (_: {
preBuild = ''
go mod tidy
'';
});
2022-06-20 23:24:30 +00:00
webapp = fetchurl {
url = "https://releases.mattermost.com/${version}/mattermost-${version}-linux-amd64.tar.gz";
hash = "sha256-qxFW/P+INcMKSzaGZtOOr1Mi/glgZeiKvQ+YN0qX070=";
2016-08-15 01:17:05 +00:00
};
vendorHash = "sha256-ZbLSxG9Gyhk7PBC2V6sMtrQNXvm+ugMfliFIHWO1VLs=";
2022-06-20 23:24:30 +00:00
subPackages = [ "cmd/mattermost" ];
2023-12-01 09:22:25 +00:00
tags = [ "production" ];
2022-06-20 23:24:30 +00:00
ldflags = [
"-s"
"-w"
"-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}"
2023-12-01 09:22:25 +00:00
"-X github.com/mattermost/mattermost/server/public/model.BuildHashEnterprise=none"
"-X github.com/mattermost/mattermost/server/public/model.BuildEnterpriseReady=false"
"-X github.com/mattermost/mattermost/server/public/model.MockCWS=false"
2022-06-20 23:24:30 +00:00
];
2022-06-20 23:24:30 +00:00
postInstall = ''
tar --strip 1 --directory $out -xf $webapp \
mattermost/{client,i18n,fonts,templates,config}
2018-05-16 17:09:19 +00:00
2022-06-20 23:24:30 +00:00
# For some reason a bunch of these files are executable
find $out/{client,i18n,fonts,templates,config} -type f -exec chmod -x {} \;
'';
2018-05-16 17:09:19 +00:00
2022-06-20 23:24:30 +00:00
passthru.tests.mattermost = nixosTests.mattermost;
2022-01-23 23:56:02 +00:00
2022-06-20 23:24:30 +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 ];
2023-12-01 09:22:25 +00:00
maintainers = with maintainers; [ ryantm numinit kranzes mgdelacroix ];
2023-11-27 01:17:53 +00:00
mainProgram = "mattermost";
2016-08-15 01:17:05 +00:00
};
2022-06-20 23:24:30 +00:00
}