spectrwm: add updateScript

This commit is contained in:
kyehn
2025-09-23 10:54:55 +08:00
parent 55b9d19380
commit eeef8eee2c
+9
View File
@@ -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";