From 91df784a3f6673f3e44d8dc0acc7ab94da45f39b Mon Sep 17 00:00:00 2001 From: stuebinm Date: Sun, 25 Feb 2024 18:51:20 +0100 Subject: [PATCH] mattermost: add passthru.updateScript Previously, updates of mattermost tended to lag behind upstream's released versions by a minor (security-patch) version or two. This should hopefully make the r-ryantm bot detect future updates automatically. Thanks to Emily Lange for explaining to me how this works! --- pkgs/servers/mattermost/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/mattermost/default.nix b/pkgs/servers/mattermost/default.nix index dbe887ee869d..c76dd152929c 100644 --- a/pkgs/servers/mattermost/default.nix +++ b/pkgs/servers/mattermost/default.nix @@ -1,6 +1,7 @@ { lib , buildGoModule , fetchFromGitHub +, nix-update-script , fetchurl , nixosTests }: @@ -8,6 +9,9 @@ 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"; src = fetchFromGitHub { @@ -63,7 +67,12 @@ buildGoModule rec { find $out/{client,i18n,fonts,templates,config} -type f -exec chmod -x {} \; ''; - passthru.tests.mattermost = nixosTests.mattermost; + passthru = { + updateScript = nix-update-script { + extraArgs = [ "--version-regex" "^v(9\.5\.([0-9.]+))" ]; + }; + tests.mattermost = nixosTests.mattermost; + }; meta = with lib; { description = "Mattermost is an open source platform for secure collaboration across the entire software development lifecycle";