mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-04-16 06:58:12 +00:00
stats: add passthru.updateScript
This commit is contained in:
parent
838623c9ac
commit
748d185aa1
@ -2,6 +2,10 @@
|
||||
, stdenvNoCC
|
||||
, fetchurl
|
||||
, undmg
|
||||
, writeShellApplication
|
||||
, curl
|
||||
, jq
|
||||
, common-updater-scripts
|
||||
}:
|
||||
|
||||
stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
@ -12,6 +16,7 @@ stdenvNoCC.mkDerivation (finalAttrs: {
|
||||
url = "https://github.com/exelban/stats/releases/download/v${finalAttrs.version}/Stats.dmg";
|
||||
hash = "sha256-B44KFrKy76IZB7QeivE4a/e8JARp4VwJs0mTffa622w=";
|
||||
};
|
||||
|
||||
sourceRoot = ".";
|
||||
|
||||
nativeBuildInputs = [ undmg ];
|
||||
@ -25,6 +30,17 @@ 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";
|
||||
|
Loading…
Reference in New Issue
Block a user