spectrwm: add updateScript
This commit is contained in:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user