From 6d2334ef22898e18404db2028655ca1d2d44e4ed Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Thu, 31 Oct 2024 09:41:27 -0500 Subject: [PATCH 1/2] skhd: darwin sdk refactor Requires 10.13 minimum --- pkgs/by-name/sk/skhd/package.nix | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/pkgs/by-name/sk/skhd/package.nix b/pkgs/by-name/sk/skhd/package.nix index 1876a43916a74..6612e3b0137f8 100644 --- a/pkgs/by-name/sk/skhd/package.nix +++ b/pkgs/by-name/sk/skhd/package.nix @@ -1,18 +1,13 @@ { lib, - overrideSDK, stdenv, - darwin, fetchFromGitHub, testers, + darwinMinVersionHook, nix-update-script, + apple-sdk_11, }: -let - inherit (darwin.apple_sdk_11_0.frameworks) Carbon Cocoa; - - stdenv' = if stdenv.hostPlatform.isDarwin then overrideSDK stdenv "11.0" else stdenv; -in -stdenv'.mkDerivation (finalAttrs: { +stdenv.mkDerivation (finalAttrs: { pname = "skhd"; version = "0.3.9"; @@ -24,8 +19,8 @@ stdenv'.mkDerivation (finalAttrs: { }; buildInputs = [ - Carbon - Cocoa + apple-sdk_11 + (darwinMinVersionHook "10.13") ]; makeFlags = [ "BUILD_PATH=$(out)/bin" ]; From b08788ace8f564c939a3f296145039b8e98ff630 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Thu, 31 Oct 2024 19:09:43 -0500 Subject: [PATCH 2/2] skhd: add versionCheckHook --- pkgs/by-name/sk/skhd/package.nix | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/pkgs/by-name/sk/skhd/package.nix b/pkgs/by-name/sk/skhd/package.nix index 6612e3b0137f8..60321fae3557a 100644 --- a/pkgs/by-name/sk/skhd/package.nix +++ b/pkgs/by-name/sk/skhd/package.nix @@ -2,10 +2,10 @@ lib, stdenv, fetchFromGitHub, - testers, + apple-sdk_11, darwinMinVersionHook, nix-update-script, - apple-sdk_11, + versionCheckHook, }: stdenv.mkDerivation (finalAttrs: { pname = "skhd"; @@ -33,14 +33,11 @@ stdenv.mkDerivation (finalAttrs: { substituteInPlace $out/Library/LaunchDaemons/org.nixos.skhd.plist --subst-var out ''; - passthru = { - tests.version = testers.testVersion { - package = finalAttrs.finalPackage; - version = "skhd-v${finalAttrs.version}"; - }; + nativeInstallCheckInputs = [ versionCheckHook ]; + versionCheckProgramArg = "--version"; + doInstallCheck = true; - updateScript = nix-update-script { }; - }; + passthru.updateScript = nix-update-script { }; meta = { description = "Simple hotkey daemon for macOS";