Skip to content

Commit

Permalink
treewide: refactor to use darwin.installBinaryPackage (bartender)
Browse files Browse the repository at this point in the history
  • Loading branch information
afh committed Jun 23, 2024
1 parent 782a806 commit 237455d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 28 deletions.
37 changes: 11 additions & 26 deletions pkgs/os-specific/darwin/bartender/default.nix
Original file line number Diff line number Diff line change
@@ -1,48 +1,33 @@
{ lib
, stdenvNoCC
, fetchurl
, _7zz
, darwin
}:

stdenvNoCC.mkDerivation (finalAttrs: {
darwin.installBinaryPackage rec {
pname = "bartender";
version = "5.0.52";

src = fetchurl {
name = "Bartender ${lib.versions.major finalAttrs.version}.dmg";
url = "https://www.macbartender.com/B2/updates/${builtins.replaceStrings [ "." ] [ "-" ] finalAttrs.version}/Bartender%20${lib.versions.major finalAttrs.version}.dmg";
url = "https://www.macbartender.com/B2/updates/${builtins.replaceStrings [ "." ] [ "-" ] version}/Bartender%20${lib.versions.major version}.dmg";
hash = "sha256-gKsDD/4z397ZpT+8xu7BI1c9r+nledzrPfD/ACexFvQ=";
};

dontPatch = true;
dontConfigure = true;
dontBuild = true;
dontFixup = true;

nativeBuildInputs = [ _7zz ];

sourceRoot = "Bartender ${lib.versions.major finalAttrs.version}.app";

installPhase = ''
runHook preInstall
mkdir -p "$out/Applications/${finalAttrs.sourceRoot}"
cp -R . "$out/Applications/${finalAttrs.sourceRoot}"
runHook postInstall
'';
appName = "Bartender ${lib.versions.major version}.app";

meta = {
description = "Take control of your menu bar";
longDescription = ''
Bartender is an award-winning app for macOS that superpowers your menu bar, giving you total control over your menu bar items, what's displayed, and when, with menu bar items only showing when you need them.
Bartender improves your workflow with quick reveal, search, custom hotkeys and triggers, and lots more.
Bartender is an award-winning app for macOS that superpowers your menu
bar, giving you total control over your menu bar items, what's displayed,
and when, with menu bar items only showing when you need them.
Bartender improves your workflow with quick reveal, search, custom
hotkeys and triggers, and lots more.
'';
homepage = "https://www.macbartender.com";
changelog = "https://www.macbartender.com/Bartender${lib.versions.major finalAttrs.version}/release_notes/";
changelog = "https://www.macbartender.com/Bartender${lib.versions.major version}/release_notes/";
license = [ lib.licenses.unfree ];
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
maintainers = with lib.maintainers; [ stepbrobd ];
platforms = [ "aarch64-darwin" "x86_64-darwin" ];
};
})
}
2 changes: 0 additions & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26703,8 +26703,6 @@ with pkgs;
ath9k-htc-blobless-firmware-unstable =
callPackage ../os-specific/linux/firmware/ath9k { enableUnstable = true; };

bartender = callPackage ../os-specific/darwin/bartender { };

b43Firmware_5_1_138 = callPackage ../os-specific/linux/firmware/b43-firmware/5.1.138.nix { };

b43Firmware_6_30_163_46 = callPackage ../os-specific/linux/firmware/b43-firmware/6.30.163.46.nix { };
Expand Down
2 changes: 2 additions & 0 deletions pkgs/top-level/darwin-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ impure-cmds // appleSourcePackages // chooseLibs // {
extraBuildInputs = [];
};

bartender = callPackage ../os-specific/darwin/bartender { };

binutils-unwrapped = callPackage ../os-specific/darwin/binutils {
inherit (pkgs) binutils-unwrapped;
inherit (pkgs.llvmPackages) llvm clang-unwrapped;
Expand Down

0 comments on commit 237455d

Please sign in to comment.