From d3af36bd3cd063519f35933a96d299a0e0b025cf Mon Sep 17 00:00:00 2001 From: stuebinm Date: Thu, 25 Mar 2021 14:59:59 +0100 Subject: [PATCH] mattermost: update to version 5.30.3 This should be compatible with the version we currently use, and also include all hot-fixes etc. which we definitely want to have. --- pkgs/default.nix | 2 ++ pkgs/mattermost/default.nix | 58 +++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 pkgs/mattermost/default.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index 193f443..4cc06a5 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -34,6 +34,8 @@ let ''; }); + mattermost = callPackage ./mattermost {}; + inherit (unstable) bottom; }; diff --git a/pkgs/mattermost/default.nix b/pkgs/mattermost/default.nix new file mode 100644 index 0000000..bde7c2f --- /dev/null +++ b/pkgs/mattermost/default.nix @@ -0,0 +1,58 @@ +{ stdenv, fetchurl, fetchFromGitHub, buildGoPackage, buildEnv }: + +let + version = "5.30.3"; + + mattermost-server = buildGoPackage rec { + pname = "mattermost-server"; + inherit version; + + src = fetchFromGitHub { + owner = "mattermost"; + repo = "mattermost-server"; + rev = "v${version}"; + sha256 = "sha256-cqP2gHv3v49EsAp0xVteKeSRSknchclmUV+9d8WN/18="; + }; + + goPackagePath = "github.com/mattermost/mattermost-server"; + + buildFlagsArray = '' + -ldflags= + -X ${goPackagePath}/model.BuildNumber=nixpkgs-${version} + ''; + + }; + + mattermost-webapp = stdenv.mkDerivation { + pname = "mattermost-webapp"; + inherit version; + + src = fetchurl { + url = "https://releases.mattermost.com/${version}/mattermost-${version}-linux-amd64.tar.gz"; + sha256 = "sha256-ZQKwHZZtyhJEPk05eGZlHSNiQTc/LD+2+4zjfvE278A="; + }; + + installPhase = '' + mkdir -p $out + tar --strip 1 --directory $out -xf $src \ + mattermost/client \ + mattermost/i18n \ + mattermost/fonts \ + mattermost/templates \ + mattermost/config + ''; + }; + +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; + }; + }