nixpkgs/pkgs/servers/mattermost/default.nix

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

52 lines
1.4 KiB
Nix
Raw Normal View History

2022-06-20 23:24:30 +00:00
{ lib
, buildGo118Module
, fetchFromGitHub
, fetchurl
, nixosTests
}:
buildGo118Module rec {
pname = "mattermost";
2022-06-24 15:24:59 +00:00
version = "7.0.1";
2022-06-20 23:24:30 +00:00
src = fetchFromGitHub {
owner = "mattermost";
repo = "mattermost-server";
rev = "v${version}";
2022-06-24 15:24:59 +00:00
sha256 = "sha256-oxZaOOV5pkK9HAi/AQ+MLZgfwvF6d/ArzYrXzUQGTDA=";
2022-06-20 23:24:30 +00:00
};
2018-05-16 17:09:19 +00:00
2022-06-20 23:24:30 +00:00
webapp = fetchurl {
url = "https://releases.mattermost.com/${version}/mattermost-${version}-linux-amd64.tar.gz";
2022-06-24 15:24:59 +00:00
sha256 = "sha256-NWVDPDqdx7mdWCr/qBi8HsUsCJbT63x37UZGecHsZr4=";
2016-08-15 01:17:05 +00:00
};
2022-06-20 23:24:30 +00:00
vendorSha256 = "sha256-0sKuk0klxeep8J96RntDP9DHsVM4vrOmsKXiaWurVis=";
2022-06-20 23:24:30 +00:00
subPackages = [ "cmd/mattermost" ];
2022-06-20 23:24:30 +00:00
ldflags = [
"-s"
"-w"
"-X github.com/mattermost/mattermost-server/v6/model.Version=${version}"
];
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 ];
maintainers = with maintainers; [ fpletz ryantm numinit kranzes ];
platforms = [ "x86_64-linux" ];
2016-08-15 01:17:05 +00:00
};
2022-06-20 23:24:30 +00:00
}