65 lines
1.9 KiB
Nix
65 lines
1.9 KiB
Nix
{ stdenv, fetchurl, fetchFromGitHub, buildGoModule, buildEnv, lib, sources }:
|
|
|
|
let
|
|
version = "8.1.10";
|
|
|
|
mattermost-server = buildGoModule rec {
|
|
pname = "mattermost-server";
|
|
inherit version;
|
|
|
|
src = "${sources.mattermost-server}/server";
|
|
|
|
# TODO: this should not be needed after the next update, assuming they don't
|
|
# again push a release without running `go mod tidy`
|
|
overrideModAttrs = (_: {
|
|
preBuild = ''
|
|
go mod tidy
|
|
'';
|
|
});
|
|
|
|
vendorHash = "sha256-ZbLSxG9Gyhk7PBC2V6sMtrQNXvm+ugMfliFIHWO1VLs=";
|
|
|
|
subPackages = [ "cmd/mattermost" ];
|
|
|
|
ldflags = [
|
|
"-s"
|
|
"-w"
|
|
"-X github.com/mattermost/mattermost/server/public/model.Version=${version}"
|
|
"-X github.com/mattermost/mattermost/server/public/model.BuildNumber=${version}-haccfiles"
|
|
"-X github.com/mattermost/mattermost/server/public/model.BuildDate=1970-01-01"
|
|
"-X github.com/mattermost/mattermost/server/public/model.BuildHash=v${version}"
|
|
"-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"
|
|
];
|
|
};
|
|
|
|
mattermost-webapp = stdenv.mkDerivation {
|
|
pname = "mattermost-webapp";
|
|
inherit version;
|
|
|
|
src = sources.mattermost-webapp;
|
|
|
|
installPhase = ''
|
|
mkdir -p $out
|
|
cp -r client $out
|
|
cp -r i18n $out
|
|
cp -r fonts $out
|
|
cp -r templates $out
|
|
cp -r config $out
|
|
'';
|
|
};
|
|
|
|
in
|
|
buildEnv {
|
|
name = "mattermost-${version}";
|
|
paths = [ mattermost-server mattermost-webapp ];
|
|
|
|
meta = with lib; {
|
|
description = "Open-source, self-hosted Slack-alternative";
|
|
homepage = "https://www.mattermost.org";
|
|
license = with licenses; [ agpl3 asl20 ];
|
|
maintainers = with maintainers; [ fpletz ryantm ];
|
|
platforms = platforms.unix;
|
|
};
|
|
}
|