From 1f42981636c0e5bce11694b7b3f67fe404dcfbd5 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Thu, 31 Oct 2024 11:20:45 -0500 Subject: [PATCH] yabai: modernize --- pkgs/by-name/ya/yabai/package.nix | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/pkgs/by-name/ya/yabai/package.nix b/pkgs/by-name/ya/yabai/package.nix index 058c9ed14207..864336442335 100644 --- a/pkgs/by-name/ya/yabai/package.nix +++ b/pkgs/by-name/ya/yabai/package.nix @@ -3,16 +3,13 @@ fetchFromGitHub, installShellFiles, testers, - writeShellScript, - common-updater-scripts, - curl, - jq, xcodebuild, xxd, yabai, apple-sdk_15, darwinMinVersionHook, llvmPackages_19, + nix-update-script, }: let stdenv = llvmPackages_19.stdenv; @@ -24,7 +21,7 @@ stdenv.mkDerivation (finalAttrs: { src = fetchFromGitHub { owner = "koekeishiya"; repo = "yabai"; - rev = "v${finalAttrs.version}"; + rev = "refs/tags/v${finalAttrs.version}"; hash = "sha256-i/UqmBNTLBYY4ORI1Y7FWr+LZK0f/qMdWLPPuTb9+2w="; }; @@ -69,24 +66,7 @@ stdenv.mkDerivation (finalAttrs: { version = "yabai-v${finalAttrs.version}"; }; - updateScript = writeShellScript "update-yabai" '' - set -o errexit - export PATH="${ - lib.makeBinPath [ - curl - jq - common-updater-scripts - ] - }" - NEW_VERSION=$(curl --silent https://api.github.com/repos/koekeishiya/yabai/releases/latest | jq '.tag_name | ltrimstr("v")' --raw-output) - if [[ "${finalAttrs.version}" = "$NEW_VERSION" ]]; then - echo "The new version same as the old version." - exit 0 - fi - for platform in ${lib.escapeShellArgs finalAttrs.meta.platforms}; do - update-source-version "yabai" "$NEW_VERSION" --ignore-same-version --source-key="sources.$platform" - done - ''; + updateScript = nix-update-script { }; }; meta = {