skhd: darwin sdk refactor (#352625)

This commit is contained in:
Weijia Wang 2024-11-01 20:18:14 +01:00 committed by GitHub
commit 7821d2d139
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,18 +1,13 @@
{
lib,
overrideSDK,
stdenv,
darwin,
fetchFromGitHub,
testers,
apple-sdk_11,
darwinMinVersionHook,
nix-update-script,
versionCheckHook,
}:
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" ];
@ -38,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";