From 4a1fadc292366874f130599ab152bfde1dcc8ba1 Mon Sep 17 00:00:00 2001 From: Morgan Jones Date: Sat, 11 Jan 2025 20:33:55 -0800 Subject: [PATCH] mattermostLatest: init at 10.3.1 --- pkgs/by-name/ma/mattermost/package.nix | 31 ++++++++++++++------ pkgs/by-name/ma/mattermostLatest/package.nix | 20 +++++++++++++ 2 files changed, 42 insertions(+), 9 deletions(-) create mode 100644 pkgs/by-name/ma/mattermostLatest/package.nix diff --git a/pkgs/by-name/ma/mattermost/package.nix b/pkgs/by-name/ma/mattermost/package.nix index 61036a0fdb9ef9..dee8d6821e9644 100644 --- a/pkgs/by-name/ma/mattermost/package.nix +++ b/pkgs/by-name/ma/mattermost/package.nix @@ -8,21 +8,31 @@ fetchNpmDeps, jq, nixosTests, + + versionInfo ? { + # 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 here as well. + # + # Ensure you also check ../mattermostLatest/package.nix. + regex = "^v(9\.11\.[0-9]+)$"; + version = "9.11.6"; + srcHash = "sha256-G9RYktnnVXdhNWp8q+bNbdlHB9ZOGtnESnZVOA7lDvE="; + vendorHash = "sha256-Gwv6clnq7ihoFC8ox8iEM5xp/us9jWUrcmqA9/XbxBE="; + npmDepsHash = "sha256-ysz38ywGxJ5DXrrcDmcmezKbc5Y7aug9jOWUzHRAs/0="; + }, }: 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.11.6"; + inherit (versionInfo) version; src = fetchFromGitHub { owner = "mattermost"; repo = "mattermost"; rev = "v${version}"; - hash = "sha256-G9RYktnnVXdhNWp8q+bNbdlHB9ZOGtnESnZVOA7lDvE="; + hash = versionInfo.srcHash; postFetch = '' cd $out/webapp @@ -54,7 +64,7 @@ buildGoModule rec { npmDeps = fetchNpmDeps { inherit src; sourceRoot = "${src.name}/webapp"; - hash = "sha256-ysz38ywGxJ5DXrrcDmcmezKbc5Y7aug9jOWUzHRAs/0="; + hash = versionInfo.npmDepsHash; makeCacheWritable = true; forceGitDeps = true; }; @@ -99,7 +109,7 @@ buildGoModule rec { ''; }; - vendorHash = "sha256-Gwv6clnq7ihoFC8ox8iEM5xp/us9jWUrcmqA9/XbxBE="; + inherit (versionInfo) vendorHash; modRoot = "./server"; preBuild = '' @@ -144,7 +154,10 @@ buildGoModule rec { updateScript = nix-update-script { extraArgs = [ "--version-regex" - "^v(9\.11\.[0-9]+)$" + versionInfo.regex + ] ++ lib.optionals (versionInfo.autoUpdate or null != null) [ + "--override-filename" + versionInfo.autoUpdate ]; }; tests.mattermost = nixosTests.mattermost; diff --git a/pkgs/by-name/ma/mattermostLatest/package.nix b/pkgs/by-name/ma/mattermostLatest/package.nix new file mode 100644 index 00000000000000..eb6b38ec14114b --- /dev/null +++ b/pkgs/by-name/ma/mattermostLatest/package.nix @@ -0,0 +1,20 @@ +{ + mattermost, +}: + +mattermost.override { + versionInfo = { + # Latest, non-RC releases only. + # If the latest is an ESR (Extended Support Release), + # duplicate it here to facilitate the update script. + # See https://docs.mattermost.com/about/mattermost-server-releases.html + # and make sure the version regex is up to date here. + # Ensure you also check ../mattermost/package.nix for ESR releases. + regex = "^v(10\.3\.[0-9]+)$"; + version = "10.3.1"; + srcHash = "sha256-nghwf9FgdqEDLkm8dKqhvY1SvALSZ8dasTDwMwbL5AI="; + vendorHash = "sha256-G2IhU8/XSITjJKNu1Iwwoabm+hG9r3kLPtZnlzuKBD8="; + npmDepsHash = "sha256-Dc+ZFQzRQoUnsZDnPs55gr6O82WwyuBEmCZYFAwW50M="; + autoUpdate = ./package.nix; + }; +}