mattermost: 8.1.10 → 9.5.1 #7

Manually merged
stuebinm merged 2 commits from mattermost-update into main 2024-02-25 16:28:10 +00:00
11 changed files with 109 additions and 72 deletions

View file

@ -57,31 +57,31 @@
"mattermost-server": {
"flake": false,
"locked": {
"lastModified": 1707502341,
"narHash": "sha256-eloO83koCNZOR/NYzUCdKOtVdF7rk+VrZ9U2bKWkxNU=",
"lastModified": 1707498729,
"narHash": "sha256-w+VF8VoS7oIcDlYS5kCFzSX4rgD9l1B99XBHeJDB6JI=",
"owner": "mattermost",
"repo": "mattermost-server",
"rev": "674f549daf0e74933845be0ae32827e498137b63",
"repo": "mattermost",
"rev": "e9f10761eef2f9ed83fcf0be8205424bcc8df9f3",
"type": "github"
},
"original": {
"owner": "mattermost",
"ref": "v8.1.10",
"repo": "mattermost-server",
"ref": "v9.5.1",
"repo": "mattermost",
"type": "github"
}
},
"mattermost-webapp": {
"flake": false,
"locked": {
"lastModified": 1707771700,
"narHash": "sha256-5PYPNcUGcQmn9RgUbtv3U/s+pRB1a2CgZwxDnunuToA=",
"lastModified": 1707772650,
"narHash": "sha256-zOHWY0T1eM0PKBcNhAtMK3sNCYkSnmH7+o4aVu34dKg=",
"type": "tarball",
"url": "https://releases.mattermost.com/8.1.10/mattermost-8.1.10-linux-amd64.tar.gz"
"url": "https://releases.mattermost.com/9.5.1/mattermost-9.5.1-linux-amd64.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://releases.mattermost.com/8.1.10/mattermost-8.1.10-linux-amd64.tar.gz"
"url": "https://releases.mattermost.com/9.5.1/mattermost-9.5.1-linux-amd64.tar.gz"
}
},
"nixos-mailserver": {
@ -162,6 +162,21 @@
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1708475490,
"narHash": "sha256-g1v0TsWBQPX97ziznfJdWhgMyMGtoBFs102xSYO4syU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "0e74ca98a74bc7270d28838369593635a5db3260",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-unstable",
"type": "indirect"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1708294118,
@ -201,6 +216,7 @@
"nixos-mailserver": "nixos-mailserver",
"nixpkgs": "nixpkgs_2",
"nixpkgs-oldstable": "nixpkgs-oldstable",
"nixpkgs-unstable": "nixpkgs-unstable",
"sops-nix": "sops-nix",
"tracktrain": "tracktrain"
}

View file

@ -2,12 +2,13 @@
description = "hacc infra stuff";
inputs = {
mattermost-webapp.url = "https://releases.mattermost.com/8.1.10/mattermost-8.1.10-linux-amd64.tar.gz";
mattermost-webapp.url = "https://releases.mattermost.com/9.5.1/mattermost-9.5.1-linux-amd64.tar.gz";
mattermost-webapp.flake = false;
mattermost-server.url = "github:mattermost/mattermost-server?ref=v8.1.10";
mattermost-server.url = "github:mattermost/mattermost?ref=v9.5.1";
mattermost-server.flake = false;
nixpkgs.url = "nixpkgs/nixos-23.11";
nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
nixpkgs-oldstable.url = "github:/NixOS/nixpkgs?rev=c4aec3c021620d98861639946123214207e98344";
nixos-mailserver.url = "gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-23.11";

View file

@ -6,6 +6,7 @@
hostAddress = "192.168.100.1";
localAddress = "192.168.100.10";
autoStart = true;
ephemeral = true;
bindMounts = {
"/persist" = {
hostPath = "/persist/containers/gitea";

View file

@ -11,6 +11,7 @@
hostAddress = "192.168.100.1";
localAddress = "192.168.100.5";
autoStart = true;
ephemeral = true;
bindMounts = {
"/persist" = {
hostPath = "/persist/containers/pad-hacc";

View file

@ -6,6 +6,7 @@
hostAddress = "192.168.100.1";
localAddress = "192.168.100.6";
autoStart = true;
ephemeral = true;
bindMounts = {
"/persist" = {
hostPath = "/persist/containers/pad-i4f";

View file

@ -10,6 +10,7 @@
privateNetwork = true;
hostAddress = "192.168.100.1";
localAddress = "192.168.100.3";
ephemeral = true;
bindMounts = {
"/persist" = {

View file

@ -6,6 +6,7 @@
privateNetwork = true;
hostAddress = "192.168.100.1";
localAddress = "192.168.100.2";
ephemeral = true;
bindMounts = {
"/persist" = {
hostPath = "/persist/containers/nextcloud";

View file

@ -45,6 +45,7 @@ in
hostAddress = "192.168.42.40";
localAddress = "192.168.42.41";
autoStart = true;
ephemeral = true;
bindMounts = {
"/persist" = {
hostPath = "/persist/containers/tracktrain";

View file

@ -6,6 +6,7 @@
hostAddress = "192.168.100.1";
localAddress = "192.168.100.9";
autoStart = true;
ephemeral = true;
bindMounts = {
"/persist" = {
hostPath = "/persist/containers/uffd";

View file

@ -3,12 +3,16 @@
let
pkgs = import sources.nixpkgs args;
oldstable = import sources.nixpkgs-oldstable args;
unstable = import sources.nixpkgs-unstable args;
callPackage = pkgs.lib.callPackageWith (pkgs // newpkgs);
newpkgs = {
mattermost = callPackage ./mattermost.nix {inherit sources;};
mattermost = callPackage ./mattermost.nix {
inherit sources;
buildGoModule = unstable.buildGo122Module;
};
tracktrain = import sources.tracktrain {
nixpkgs = pkgs;

View file

@ -1,65 +1,74 @@
{ stdenv, fetchurl, fetchFromGitHub, buildGoModule, buildEnv, lib, sources }:
{ lib
, sources
, buildGoModule
, fetchFromGitHub
, nix-update-script
, fetchurl
, nixosTests
}:
let
version = "8.1.10";
buildGoModule rec {
pname = "mattermost";
# ESR releases only.
# See https://docs.mattermost.com/upgrade/extended-support-release.html
# When a new ESR version is available (e.g. 8.1.x -> 9.5.x), update
# the version regex in passthru.updateScript as well.
version = "9.5.1";
mattermost-server = buildGoModule rec {
pname = "mattermost-server";
inherit version;
src = sources.mattermost-server;
webapp = sources.mattermost-webapp;
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
# Needed because buildGoModule does not support go workspaces yet.
# We use go 1.22's workspace vendor command, which is not yet available
# in the default version of go used in nixpkgs, nor is it used by upstream:
# https://github.com/mattermost/mattermost/issues/26221#issuecomment-1945351597
overrideModAttrs = (_: {
buildPhase = ''
make setup-go-work
go work vendor -e
'';
});
vendorHash = "sha256-TJCtgNf56A1U0EbV5gXjTro+YudVBRWiSZoBC3nJxnE=";
modRoot = "./server";
preBuild = ''
make setup-go-work
'';
subPackages = [ "cmd/mattermost" "cmd/mmctl" ];
tags = [ "production" ];
ldflags = [
"-s"
"-w"
"-X github.com/mattermost/mattermost/server/public/model.Version=${version}"
"-X github.com/mattermost/mattermost/server/public/model.BuildNumber=${version}-nixpkgs"
"-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"
];
postInstall = ''
cp -r $webapp/{client,i18n,fonts,templates,config} $out
# For some reason a bunch of these files are executable
find $out/{client,i18n,fonts,templates,config} -type f -exec chmod -x {} \;
'';
passthru = {
updateScript = nix-update-script {
extraArgs = [ "--version-regex" "^v(9\.5\.([0-9.]+))" ];
};
tests.mattermost = nixosTests.mattermost;
};
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;
};
}
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; [ ryantm numinit kranzes mgdelacroix ];
mainProgram = "mattermost";
};
}