nixpkgs/pkgs/servers/mattermost/default.nix

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

56 lines
1.8 KiB
Nix
Raw Normal View History

2022-06-21 02:24:30 +03:00
{ lib
, buildGoModule
2022-06-21 02:24:30 +03:00
, fetchFromGitHub
, fetchurl
, nixosTests
}:
buildGoModule rec {
2022-06-21 02:24:30 +03:00
pname = "mattermost";
2022-12-30 22:43:23 +03:00
version = "7.5.2";
2022-06-21 02:24:30 +03:00
src = fetchFromGitHub {
owner = "mattermost";
repo = "mattermost-server";
rev = "v${version}";
2022-12-30 22:43:23 +03:00
sha256 = "sha256-Jm7bu/RoFp7h38Ygis3U2E7Hbbj4zmRPc4PacxxASsw=";
2022-06-21 02:24:30 +03:00
};
2018-05-16 20:09:19 +03:00
2022-06-21 02:24:30 +03:00
webapp = fetchurl {
url = "https://releases.mattermost.com/${version}/mattermost-${version}-linux-amd64.tar.gz";
2022-12-30 22:43:23 +03:00
sha256 = "sha256-Zvzme6Og/LLsT4XyFDAQscNgO+jCwwzDDytYOo4qM0U=";
2016-08-15 04:17:05 +03:00
};
2022-09-16 07:41:08 +03:00
vendorSha256 = "sha256-qZQXNVbJZDddVE+xk6F8XJCEg5dhhuXz68wcn2Uvmxk=";
2022-06-21 02:24:30 +03:00
subPackages = [ "cmd/mattermost" ];
2022-06-21 02:24:30 +03:00
ldflags = [
"-s"
"-w"
"-X github.com/mattermost/mattermost-server/v6/model.Version=${version}"
2022-12-30 22:43:23 +03: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-06-21 02:24:30 +03:00
];
2022-06-21 02:24:30 +03:00
postInstall = ''
tar --strip 1 --directory $out -xf $webapp \
mattermost/{client,i18n,fonts,templates,config}
2018-05-16 20:09:19 +03:00
2022-06-21 02:24:30 +03: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 20:09:19 +03:00
2022-06-21 02:24:30 +03:00
passthru.tests.mattermost = nixosTests.mattermost;
2022-01-24 02:56:02 +03:00
2022-06-21 02:24:30 +03: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 ];
maintainers = with maintainers; [ ryantm numinit kranzes ];
2016-08-15 04:17:05 +03:00
};
2022-06-21 02:24:30 +03:00
}