From ae8bf7c8f602a38213601a9df12d926c997f4760 Mon Sep 17 00:00:00 2001 From: schweby Date: Wed, 28 Apr 2021 22:24:35 +0200 Subject: [PATCH] sources: manage mattermost with niv also reenables mattermost also updated to version 5.34.2 --- hosts/hainich/configuration.nix | 2 +- nix/sources.json | 20 ++++++++++++++++++++ pkgs/mattermost/default.nix | 26 +++++++++----------------- 3 files changed, 30 insertions(+), 18 deletions(-) diff --git a/hosts/hainich/configuration.nix b/hosts/hainich/configuration.nix index 02ae012..4c7ad8a 100644 --- a/hosts/hainich/configuration.nix +++ b/hosts/hainich/configuration.nix @@ -19,7 +19,7 @@ ./services/monitoring.nix ./services/workadventure.nix ./services/minecraft.nix -# ./services/mattermost.nix + ./services/mattermost.nix ]; boot.loader.grub.enable = true; boot.loader.grub.version = 2; diff --git a/nix/sources.json b/nix/sources.json index 2cf39af..4a36436 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -17,6 +17,26 @@ "url": "https://github.com/nix-community/home-manager/archive/2aa20ae969f2597c4df10a094440a66e9d7f8c86.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, + "mattermost-server": { + "branch": "release-5.31", + "description": "Open source Slack-alternative in Golang and React - Mattermost", + "homepage": "https://mattermost.com", + "owner": "mattermost", + "repo": "mattermost-server", + "rev": "7d89f8bc6ef757877572ef12f3c3c018858318d6", + "sha256": "18ip32asar8c34zhnf29v3a66a433443pz7rxa2f4vnp0ri1jil6", + "type": "tarball", + "url": "https://github.com/mattermost/mattermost-server/archive/7d89f8bc6ef757877572ef12f3c3c018858318d6.tar.gz", + "url_template": "https://github.com///archive/.tar.gz", + "version": "5.34.2" + }, + "mattermost-webapp": { + "sha256": "1a1z3p166bs7ygnnbhm8b556wxmljnk2sj4q527jpr437f02fl6z", + "type": "tarball", + "url": "https://releases.mattermost.com/5.34.2/mattermost-5.34.2-linux-amd64.tar.gz", + "url_template": "https://releases.mattermost.com//mattermost--linux-amd64.tar.gz", + "version": "5.34.2" + }, "mumble-website": { "branch": "master", "repo": "https://gitlab.infra4future.de/hacc/infra4future/mumble.infra4future.de.git", diff --git a/pkgs/mattermost/default.nix b/pkgs/mattermost/default.nix index bde7c2f..5bc26af 100644 --- a/pkgs/mattermost/default.nix +++ b/pkgs/mattermost/default.nix @@ -1,18 +1,14 @@ { stdenv, fetchurl, fetchFromGitHub, buildGoPackage, buildEnv }: let - version = "5.30.3"; + sources = import ../../nix/sources.nix; + version = sources.mattermost-webapp.version; mattermost-server = buildGoPackage rec { pname = "mattermost-server"; inherit version; - src = fetchFromGitHub { - owner = "mattermost"; - repo = "mattermost-server"; - rev = "v${version}"; - sha256 = "sha256-cqP2gHv3v49EsAp0xVteKeSRSknchclmUV+9d8WN/18="; - }; + src = sources.mattermost-server.outPath; goPackagePath = "github.com/mattermost/mattermost-server"; @@ -27,19 +23,15 @@ let 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="; - }; + src = sources.mattermost-webapp; installPhase = '' mkdir -p $out - tar --strip 1 --directory $out -xf $src \ - mattermost/client \ - mattermost/i18n \ - mattermost/fonts \ - mattermost/templates \ - mattermost/config + cp -r client $out + cp -r i18n $out + cp -r fonts $out + cp -r templates $out + cp -r config $out ''; };