From 53081d312162fd5fa32cb98b61ad333bfca95cf2 Mon Sep 17 00:00:00 2001 From: DontEatOreo <57304299+DontEatOreo@users.noreply.github.com> Date: Mon, 20 May 2024 22:23:19 +0300 Subject: [PATCH] stats: refactor updateScript --- pkgs/by-name/st/stats/package.nix | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/pkgs/by-name/st/stats/package.nix b/pkgs/by-name/st/stats/package.nix index bdd58b2d8e78..0d8918653254 100644 --- a/pkgs/by-name/st/stats/package.nix +++ b/pkgs/by-name/st/stats/package.nix @@ -3,10 +3,7 @@ stdenvNoCC, fetchurl, undmg, - writeShellApplication, - curl, - jq, - common-updater-scripts, + nix-update-script, }: stdenvNoCC.mkDerivation (finalAttrs: { @@ -31,20 +28,7 @@ stdenvNoCC.mkDerivation (finalAttrs: { runHook postInstall ''; - passthru.updateScript = lib.getExe (writeShellApplication { - name = "stats-update-script"; - runtimeInputs = [ - curl - jq - common-updater-scripts - ]; - text = '' - set -euo pipefail - url="$(curl --silent "https://api.github.com/repos/exelban/stats/tags?per_page=1")" - version="$(echo "$url" | jq -r '.[0].name' | cut -c 2-)" - update-source-version stats "$version" --file=./pkgs/by-name/st/stats/package.nix - ''; - }); + passthru.updateScript = nix-update-script { }; meta = with lib; { description = "macOS system monitor in your menu bar";