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";