haccfiles/pkgs/mattermost/default.nix
schweby ae8bf7c8f6
sources: manage mattermost with niv
also reenables mattermost
also updated to version 5.34.2
2021-04-28 22:29:31 +02:00

50 lines
1.2 KiB
Nix

{ stdenv, fetchurl, fetchFromGitHub, buildGoPackage, buildEnv }:
let
sources = import ../../nix/sources.nix;
version = sources.mattermost-webapp.version;
mattermost-server = buildGoPackage rec {
pname = "mattermost-server";
inherit version;
src = sources.mattermost-server.outPath;
goPackagePath = "github.com/mattermost/mattermost-server";
buildFlagsArray = ''
-ldflags=
-X ${goPackagePath}/model.BuildNumber=nixpkgs-${version}
'';
};
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 stdenv.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;
};
}