Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 58 lines 1.7 kB view raw
1{ 2 lib, 3 stdenvNoCC, 4 fetchurl, 5 undmg, 6 nix-update-script, 7 versionCheckHook, 8 writeShellScript, 9 xcbuild, 10}: 11 12stdenvNoCC.mkDerivation (finalAttrs: { 13 pname = "betterdisplay"; 14 version = "3.4.1"; 15 16 src = fetchurl { 17 url = "https://github.com/waydabber/BetterDisplay/releases/download/v${finalAttrs.version}/BetterDisplay-v${finalAttrs.version}.dmg"; 18 hash = "sha256-GTyFtW0qlYjrGl8eFuXFGudlx7304wb4KxqHKFzsH+c="; 19 }; 20 21 dontPatch = true; 22 dontConfigure = true; 23 dontBuild = true; 24 dontFixup = true; 25 26 buildInputs = [ undmg ]; 27 28 sourceRoot = "."; 29 installPhase = '' 30 runHook preInstall 31 32 mkdir -p $out/Applications 33 mv BetterDisplay.app $out/Applications 34 35 runHook postInstall 36 ''; 37 38 nativeInstallCheckInputs = [ versionCheckHook ]; 39 versionCheckProgram = writeShellScript "version-check" '' 40 ${xcbuild}/bin/PlistBuddy -c "Print :CFBundleShortVersionString" "$1" 41 ''; 42 versionCheckProgramArg = [ 43 "${placeholder "out"}/Applications/BetterDisplay.app/Contents/Info.plist" 44 ]; 45 doInstallCheck = true; 46 47 passthru.updateScript = nix-update-script { }; 48 49 meta = { 50 description = "Unlock your displays on your Mac! Flexible HiDPI scaling, XDR/HDR extra brightness, virtual screens, DDC control, extra dimming, PIP/streaming, EDID override and lots more"; 51 homepage = "https://betterdisplay.pro/"; 52 changelog = "https://github.com/waydabber/BetterDisplay/releases/tag/v${finalAttrs.version}"; 53 license = [ lib.licenses.unfree ]; 54 sourceProvenance = [ lib.sourceTypes.binaryNativeCode ]; 55 maintainers = with lib.maintainers; [ DimitarNestorov ]; 56 platforms = lib.platforms.darwin; 57 }; 58})