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 Mar 7, 2024
1 parent 23e142a commit c424494
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 30 deletions.
39 changes: 11 additions & 28 deletions pkgs/os-specific/darwin/bartender/default.nix
Original file line number Diff line number Diff line change
@@ -1,48 +1,31 @@
{ lib
, stdenvNoCC
, fetchurl
, _7zz
, darwin
}:

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

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-DOQLtdbwYFyRri3GBdjLfFNII65QJMvAQu9Be4ATBx0=";
};

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 = with lib; {
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 = with licenses; [ unfree ];
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
maintainers = with 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 @@ -27325,8 +27325,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 @@ -80,6 +80,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 c424494

Please sign in to comment.