From eeef8eee2c514b2cb7a0472fc33a63a0f717a905 Mon Sep 17 00:00:00 2001 From: kyehn Date: Tue, 23 Sep 2025 10:54:46 +0800 Subject: [PATCH] spectrwm: add updateScript --- pkgs/by-name/sp/spectrwm/package.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/by-name/sp/spectrwm/package.nix b/pkgs/by-name/sp/spectrwm/package.nix index 88129f8bb349..51ee4a77e043 100644 --- a/pkgs/by-name/sp/spectrwm/package.nix +++ b/pkgs/by-name/sp/spectrwm/package.nix @@ -11,6 +11,10 @@ xcbutil, xcbutilkeysyms, xcbutilwm, + writeShellScript, + curl, + jq, + nix-update, }: stdenv.mkDerivation (finalAttrs: { @@ -40,6 +44,11 @@ stdenv.mkDerivation (finalAttrs: { makeFlags = [ "PREFIX=${placeholder "out"}" ]; + passthru.updateScript = writeShellScript "update-spectrwm" '' + latestVersion=$(${lib.getExe curl} ''${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} --silent --fail --location https://api.github.com/repos/conformal/spectrwm/releases/latest | ${lib.getExe jq} --raw-output .tag_name | grep -oP '\d+' | paste -sd.) + ${lib.getExe nix-update} spectrwm --version=$latestVersion + ''; + meta = { description = "Tiling window manager"; homepage = "https://github.com/conformal/spectrwm";