about summary refs log tree commit diff
path: root/pkgs/by-name/st/stats/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/st/stats/package.nix')
-rw-r--r--pkgs/by-name/st/stats/package.nix22
1 files changed, 19 insertions, 3 deletions
diff --git a/pkgs/by-name/st/stats/package.nix b/pkgs/by-name/st/stats/package.nix
index e52e1d0ca2287..b907d5b2db817 100644
--- a/pkgs/by-name/st/stats/package.nix
+++ b/pkgs/by-name/st/stats/package.nix
@@ -2,16 +2,21 @@
 , stdenvNoCC
 , fetchurl
 , undmg
+, writeShellApplication
+, curl
+, jq
+, common-updater-scripts
 }:
 
 stdenvNoCC.mkDerivation (finalAttrs: {
   pname = "stats";
-  version = "2.10.7";
+  version = "2.10.10";
 
   src = fetchurl {
     url = "https://github.com/exelban/stats/releases/download/v${finalAttrs.version}/Stats.dmg";
-    hash = "sha256-B44KFrKy76IZB7QeivE4a/e8JARp4VwJs0mTffa622w=";
+    hash = "sha256-CdTY5Qv/xF9ItNgHQFqec5nKObnImx/+MuFShTfdrAo=";
   };
+
   sourceRoot = ".";
 
   nativeBuildInputs = [ undmg ];
@@ -25,12 +30,23 @@ 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
+    '';
+  });
+
   meta = with lib; {
     description = "macOS system monitor in your menu bar";
     homepage = "https://github.com/exelban/stats";
     license = licenses.mit;
     sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
-    maintainers = with maintainers; [ emilytrau Enzime ];
+    maintainers = with maintainers; [ emilytrau Enzime donteatoreo ];
     platforms = platforms.darwin;
   };
 })