25 Commits
Author SHA1 Message Date
Zhaofeng LiandGitHub 60623ec512 Merge pull request #162 from ELD/update-brew-src
brew-src: 6.0.11 -> 6.0.12
2026-07-24 11:26:01 -04:00
Eric Dattore 0a58629fa9 brew-src: 6.0.11 -> 6.0.12
Updates the brew CLI to support new install steps in formulaes that
break on older versions of the brew CLI.
2026-07-21 14:37:03 -06:00
Zhaofeng LiandGitHub 842eeb863e Merge pull request #160 from zhaofengli/brew-6.0.11
brew-src: 6.0.9 -> 6.0.11
2026-07-15 19:54:24 -04:00
Zhaofeng Li 52524493b5 brew-src: 6.0.9 -> 6.0.11 2026-07-15 13:14:48 -04:00
Zhaofeng LiandGitHub 60641da832 Merge pull request #158 from Azd325/bump-brew-6.0.7
brew-src: 6.0.1 -> 6.0.9
2026-07-12 13:04:18 -04:00
Tim Kleinschmidt be2ea0e091 brew-src: 6.0.7 -> 6.0.9 2026-07-09 08:11:50 +02:00
Tim Kleinschmidt c3fca26799 brew-src: 6.0.1 -> 6.0.7
Includes Homebrew/brew#22961, which adds the `init_data_dir`
InstallSteps DSL action. Without it, homebrew-core's current
postgresql@18 formula fails with:

    undefined method 'init_data_dir' for an instance of
    Homebrew::InstallSteps::DSL
2026-07-06 20:44:32 +02:00
Zhaofeng LiandGitHub de7953a08e Merge pull request #157 from zhaofengli/tap-trust
Add support for adding trust entries during activation
2026-06-13 18:20:46 -04:00
Zhaofeng Li df1ada99b7 Add support for adding trust entries during activation
Instead of trusting whole taps automatically, let the user configure
what to trust. I think this implementation better aligns with upstream
intent.

Fixes #156.
2026-06-13 17:55:36 -04:00
Zhaofeng LiandGitHub 5e721fc775 Merge pull request #154 from zhaofengli/brew-6.0.0
brew-src: 5.1.14 -> 6.0.1
2026-06-12 09:05:51 -04:00
Zhaofeng Li 6835b13e03 ci: Update deprecated nixfmt-rfc-style alias 2026-06-12 08:35:11 -04:00
Zhaofeng Li 9c3819c9d6 Fix Homebrew README.md matching
Now there's a 🍺 emoji.
2026-06-12 08:35:11 -04:00
Zhaofeng Li 716a3c73f5 brew-src: 5.1.14 -> 6.0.0 2026-06-12 08:35:11 -04:00
Zhaofeng LiandGitHub e3f2579efe Merge pull request #150 from TyceHerrman/fix/tap-validation
Fix cask tap materialization
2026-06-11 23:33:48 -04:00
Tyce HerrmanandZhaofeng Li 6a201170a3 Fix cask tap materialization 2026-06-11 22:59:00 -04:00
Zhaofeng LiandGitHub 562332f97d Merge pull request #147 from Azd325/brew-5.1.14
chore(deps): upgrade brew-src to 5.1.14
2026-06-03 09:14:27 -04:00
Tim Kleinschmidt ec9ad01617 chore(deps): upgrade brew-src to 5.1.14 2026-06-02 15:13:54 +02:00
Zhaofeng LiandGitHub b3a87b4793 Merge pull request #141 from zhaofengli/brew-5.1.11
brew-src: 5.1.10 -> 5.1.11
2026-05-15 09:26:04 -04:00
Zhaofeng Li 4b41cb0579 brew-src: 5.1.10 -> 5.1.11 2026-05-15 08:56:42 -04:00
Zhaofeng LiandGitHub 7d0038b5bb Merge pull request #136 from matinzd/patch-1
chore: update homebrew to 5.1.10
2026-05-09 09:16:31 -04:00
Matin Zadeh DolatabadandZhaofeng Li f128474792 brew-src: 5.1.7 -> 5.1.10
Fixes #138.

Bug: https://github.com/Homebrew/brew/issues/22165#issuecomment-4396297893
2026-05-09 09:04:14 -04:00
Zhaofeng LiandGitHub aeb2069920 Merge pull request #133 from Azd325/main
chore(deps): upgrade brew-src to 5.1.7
2026-04-26 20:43:41 -04:00
Tim Kleinschmidt 8eb1c803b4 fix(deps): adapt brew.tail.sh to Homebrew 5.1.7 changes 2026-04-24 18:20:36 +02:00
Tim Kleinschmidt 0ea5a1aa98 chore(deps): upgrade brew-src to 5.1.7 2026-04-24 18:16:42 +02:00
Zhaofeng LiandGitHub a7760a3a83 Merge pull request #130 from zhaofengli/brew-5.1.1
brew-src: 5.0.12 -> 5.1.1
2026-03-28 13:51:07 -04:00
9 changed files with 251 additions and 34 deletions
+30
View File
@@ -64,6 +64,17 @@ If you haven't installed Homebrew before, use the following configuration:
#
# With mutableTaps disabled, taps can no longer be added imperatively with `brew tap`.
mutableTaps = false;
# Optional: Declarative Homebrew tap trust entries.
#
# Note: The trust entries are _not_ removed if you remove them from those lists!
# Use the `brew untrust` command to remove a trust entry.
trust = {
formulae = [ ];
casks = [ ];
commands = [ ];
taps = [ ];
};
};
}
# Optional: Align homebrew taps config with nix-homebrew
@@ -83,6 +94,25 @@ With `nix-homebrew.mutableTaps = false`, taps can be removed by deleting the cor
Setting `homebrew.taps` to equal `nix-homebrew.taps` attribute names reduces configuration mismatches.
For non-official taps, Homebrew requires [explicit trust](https://docs.brew.sh/Tap-Trust).
You may use imperative `brew trust`/`brew untrust` commands, or configure `nix-homebrew` to add trust entries during activation:
```nix
nix-homebrew.trust = {
formulae = [ "user/repo/formula" ];
casks = [ "user/repo/cask" ];
commands = [ "user/repo/command" ];
# To quote upstream documentation:
# > Trust a whole tap only when you are comfortable with all current and
# > future formulae, casks and external commands from that tap being loaded
# > by Homebrew.
taps = [ "user/repo" ];
};
```
Note that when you remove items from those lists, the corresponding trust entries are _not_ removed automatically.
Use the `brew untrust` command to remove a trust entry.
### B. Existing Homebrew Installation
If you've already installed Homebrew with the official script, you can let `nix-homebrew` automatically migrate it:
Generated
+16 -16
View File
@@ -16,21 +16,21 @@
"type": "github"
}
},
"nix-darwin_25_11": {
"nix-darwin_26_05": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1772129556,
"narHash": "sha256-Utk0zd8STPsUJPyjabhzPc5BpPodLTXrwkpXBHYnpeg=",
"lastModified": 1780789116,
"narHash": "sha256-+/LcDMJGYQVLp3ECZ1jBhj3GcQU+Yt+OTsDsQFz8cMs=",
"owner": "nix-darwin",
"repo": "nix-darwin",
"rev": "ebec37af18215214173c98cf6356d0aca24a2585",
"rev": "731951a251ca96cbd12a8e1bde63737e21947644",
"type": "github"
},
"original": {
"owner": "nix-darwin",
"ref": "nix-darwin-25.11",
"ref": "nix-darwin-26.05",
"repo": "nix-darwin",
"type": "github"
}
@@ -75,16 +75,16 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1764491476,
"narHash": "sha256-E4rtgPS7fntINb6fVJ5qQdkhfbZn8pzMYNdmiXqZmCo=",
"lastModified": 1779622335,
"narHash": "sha256-ViA62qtL5za7V3d5I8OA9q9JcFhsVAiL5jVHwEclWqk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "54f09efd2ca0dd5bb9c5fafc89573ab3ac44701d",
"rev": "705e9929918b43bd7b715dc0a878ac870449bb03",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-25.11-darwin",
"ref": "nixpkgs-26.05-darwin",
"repo": "nixpkgs",
"type": "github"
}
@@ -105,18 +105,18 @@
"type": "github"
}
},
"nixpkgs_25_11": {
"nixpkgs_26_05": {
"locked": {
"lastModified": 1774388614,
"narHash": "sha256-tFwzTI0DdDzovdE9+Ras6CUss0yn8P9XV4Ja6RjA+nU=",
"lastModified": 1780902259,
"narHash": "sha256-q8yYEC5f1mFlQO9RGna4LTc9QrcvWunX6FYp83munkQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1073dad219cb244572b74da2b20c7fe39cb3fa9e",
"rev": "bd0ff2d3eac24699c3664d5966b9ef36f388e2ca",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-25.11",
"ref": "nixos-26.05",
"repo": "nixpkgs",
"type": "github"
}
@@ -140,10 +140,10 @@
"root": {
"inputs": {
"flake-compat": "flake-compat",
"nix-darwin_25_11": "nix-darwin_25_11",
"nix-darwin_26_05": "nix-darwin_26_05",
"nix-darwin_unstable": "nix-darwin_unstable",
"nix-github-actions": "nix-github-actions",
"nixpkgs_25_11": "nixpkgs_25_11",
"nixpkgs_26_05": "nixpkgs_26_05",
"nixpkgs_unstable": "nixpkgs_unstable"
}
}
+6 -6
View File
@@ -2,10 +2,10 @@
{
inputs = {
nixpkgs_unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs_25_11.url = "github:NixOS/nixpkgs/nixos-25.11";
nixpkgs_26_05.url = "github:NixOS/nixpkgs/nixos-26.05";
nix-darwin_unstable.url = "github:nix-darwin/nix-darwin";
nix-darwin_25_11.url = "github:nix-darwin/nix-darwin/nix-darwin-25.11";
nix-darwin_26_05.url = "github:nix-darwin/nix-darwin/nix-darwin-26.05";
nix-github-actions = {
url = "github:nix-community/nix-github-actions";
@@ -31,9 +31,9 @@
nixpkgs = inputs.nixpkgs_unstable;
nix-darwin = inputs.nix-darwin_unstable;
};
"25.11" = {
nixpkgs = inputs.nixpkgs_25_11;
nix-darwin = inputs.nix-darwin_25_11;
"26.05" = {
nixpkgs = inputs.nixpkgs_26_05;
nix-darwin = inputs.nix-darwin_26_05;
};
};
@@ -112,7 +112,7 @@
pkgs:
pkgs.mkShell {
nativeBuildInputs = with pkgs; [
nixfmt-rfc-style
nixfmt
];
BREW_SRC = brew-src;
+102 -2
View File
@@ -67,6 +67,88 @@ let
)
];
};
makeTapValidationTest =
module:
makeTest (
{ pkgs, config, ... }:
let
prefixName =
if pkgs.stdenv.hostPlatform.isAarch64 then
config.nix-homebrew.defaultArm64Prefix
else
config.nix-homebrew.defaultIntelPrefix;
library = config.nix-homebrew.prefixes.${prefixName}.library;
fakeCaskTap = pkgs.runCommandLocal "homebrew-cask-test-tap" { } ''
mkdir -p "$out/Casks/u"
touch "$out/Casks/u/ungoogled-chromium.rb"
'';
fakeThirdPartyTap = pkgs.runCommandLocal "thirdparty-test-tap" { } ''
mkdir -p "$out/Formula" "$out/Casks" "$out/cmd"
touch "$out/Formula/foo.rb"
touch "$out/Casks/test-cask.rb"
touch "$out/cmd/brew-test-command.rb"
'';
in
{
imports = [
module
];
_module.args.library = library;
nix-homebrew = {
enable = true;
autoMigrate = true;
taps = {
"homebrew/homebrew-cask" = fakeCaskTap;
"thirdparty/homebrew-testtap" = fakeThirdPartyTap;
};
trust = {
formulae = [ "thirdparty/testtap/foo" ];
casks = [ "thirdparty/testtap/test-cask" ];
commands = [ "thirdparty/testtap/test-command" ];
};
};
ci.preScript = ''
>&2 echo "Removing runner Homebrew taps before declarative tap validation"
if [[ -e "${library}/Taps" || -L "${library}/Taps" ]]; then
sudo rm -rf "${library}/Taps"
fi
'';
ci.postScript = ''
>&2 echo "Checking declarative cask tap realpaths"
tap_root="${library}/Taps"
cask_path="$tap_root/homebrew/homebrew-cask/Casks/u/ungoogled-chromium.rb"
test -f "$cask_path"
>&2 echo "Checking declarative Homebrew trust entries"
brew trust --json=v1 --formula | grep '"thirdparty/testtap/foo"'
brew trust --json=v1 --cask | grep '"thirdparty/testtap/test-cask"'
brew trust --json=v1 --command | grep '"thirdparty/testtap/test-command"'
if brew trust --json=v1 --tap | grep '"thirdparty/testtap"'; then
>&2 echo "Expected thirdparty/testtap not to be trusted as a whole tap"
exit 1
fi
tap_root_real="$(${pkgs.coreutils}/bin/realpath "$tap_root")"
cask_real="$(${pkgs.coreutils}/bin/realpath "$cask_path")"
case "$cask_real" in
"$tap_root_real"/*) ;;
*)
>&2 echo "Expected cask realpath to stay under managed Taps root"
>&2 echo "Taps realpath: $tap_root_real"
>&2 echo "Cask realpath: $cask_real"
exit 1
;;
esac
'';
}
);
in
{
migrate = makeTest (
@@ -89,13 +171,15 @@ in
ci.postScript = ''
>&2 echo "Checking brew"
which brew
'' + lib.optionalString pkgs.stdenv.hostPlatform.isAarch64 ''
''
+ lib.optionalString pkgs.stdenv.hostPlatform.isAarch64 ''
>&2 echo "Checking that we can still use the unbound package"
$(brew --prefix)/sbin/unbound -V
>&2 echo "Checking that we can still use the tap we added imperatively"
brew install koekeishiya/formulae/yabai
'' + lib.optionalString config.nix-homebrew.enableRosetta ''
''
+ lib.optionalString config.nix-homebrew.enableRosetta ''
>&2 echo "Checking we can execute the Intel brew with arch -x86_64"
arch -x86_64 /usr/local/bin/brew config | grep "HOMEBREW_PREFIX: /usr/local"
@@ -106,6 +190,22 @@ in
}
);
tap-validation-mutable = makeTapValidationTest { };
tap-validation-declarative = makeTapValidationTest (
{ library, ... }:
{
nix-homebrew.mutableTaps = false;
ci.preScript = ''
>&2 echo "Removing runner Homebrew taps before declarative tap validation"
if [[ -e "${library}/Taps" || -L "${library}/Taps" ]]; then
sudo rm -rf "${library}/Taps"
fi
'';
}
);
nuke-homebrew-repository = makeTest {
ci.script = lib.mkForce ''
cat "${tools.nuke-homebrew-repository.passthru.tests.test-nuke}"
Generated
+4 -4
View File
@@ -3,16 +3,16 @@
"brew-src": {
"flake": false,
"locked": {
"lastModified": 1774235677,
"narHash": "sha256-0ryNYmzDAeRlrzPTAgmzGH/Cgc8iv/LBN6jWGUANvIk=",
"lastModified": 1784558651,
"narHash": "sha256-woXJ1ATKpSYRWCy46TQJjmm9XzAeZVEZw9xDfVG9NYI=",
"owner": "Homebrew",
"repo": "brew",
"rev": "894a3d23ac0c8aaf561b9874b528b9cb2e839201",
"rev": "b48c7994b5f0eed7bef532efa63cb4e4f763887a",
"type": "github"
},
"original": {
"owner": "Homebrew",
"ref": "5.1.1",
"ref": "6.0.12",
"repo": "brew",
"type": "github"
}
+1 -1
View File
@@ -3,7 +3,7 @@
inputs = {
brew-src = {
url = "github:Homebrew/brew/5.1.1";
url = "github:Homebrew/brew/6.0.12";
flake = false;
};
};
+5
View File
@@ -112,15 +112,19 @@ done
# We don't want to take the user's value for, e.g., `HOMEBREW_PATH` here!
USED_BY_HOMEBREW_VARS=(
CARGO_HOME
CARGO_INSTALL_ROOT
CODESPACES
COLORTERM
DBUS_SESSION_BUS_ADDRESS
GOBIN
GOPATH
LANG
NODENV_ROOT
PATH
PYENV_ROOT
RBENV_ROOT
RUSTUP_HOME
SSH_TTY
SUDO_USER
TMPDIR
@@ -130,6 +134,7 @@ USED_BY_HOMEBREW_VARS=(
XDG_CACHE_HOME
XDG_CONFIG_HOME
XDG_DATA_DIRS
XDG_DATA_HOME
XDG_RUNTIME_DIR
ZDOTDIR
)
+86 -4
View File
@@ -252,6 +252,19 @@ let
exit 1
fi
/bin/ln -shf "${makeBinBrew prefix}" "$BIN_BREW"
${setupTrust}
'';
setupTrust = let
trustEntries = flag: entries: lib.concatMapStrings (entry: ''
/usr/bin/sudo -n -u ${lib.escapeShellArg cfg.user} -H "$BIN_BREW" trust ${flag} ${lib.escapeShellArg entry} >/dev/null
'') entries;
in ''
${trustEntries "--tap" cfg.trust.taps}
${trustEntries "--formula" cfg.trust.formulae}
${trustEntries "--cask" cfg.trust.casks}
${trustEntries "--command" cfg.trust.commands}
'';
setupTaps = taps:
@@ -268,24 +281,31 @@ let
error "$tty_underline${namespaceDir}$tty_reset is in the way and needs to be moved out for $tty_underline${path}$tty_reset"
exit 1
fi
if is_occupied "${tapDir}"; then
if [[ -L "${tapDir}" ]]; then
rm "${tapDir}"
elif [[ -d "${tapDir}" ]]; then
:
# directory
elif is_occupied "${tapDir}"; then
error "An existing $tty_underline${tapDir}$tty_reset is in the way"
exit 1
fi
"''${MKDIR[@]}" "${namespaceDir}"
"''${CHOWN[@]}" "$NIX_HOMEBREW_UID:$NIX_HOMEBREW_GID" "${namespaceDir}"
"''${CHMOD[@]}" "ug=rwx" "${namespaceDir}"
/bin/ln -shf "${target}" "${tapDir}"
/usr/bin/rsync -rL --delete "${target}/" "${tapDir}"
'') (builtins.attrNames taps)
# Fully declarative taps
else let
env = pkgs.runCommandLocal "taps-env" {} (lib.concatMapStrings (path: let
env = pkgs.runCommandLocal "taps-env" { } (''
mkdir -p "$out"
'' + lib.concatMapStrings (path: let
namespace = builtins.head (lib.splitString "/" path);
target = taps.${path};
in ''
mkdir -p "$out/${namespace}"
ln -s "${target}" "$out/${path}"
cp -RH "${target}" "$out/${path}"
'') (builtins.attrNames taps));
in ''
if is_occupied "$HOMEBREW_LIBRARY/Taps"; then
@@ -383,6 +403,68 @@ in {
type = types.bool;
default = true;
};
trust = lib.mkOption {
description = ''
Tap trust entries to be added during activation.
Note: The trust entries are _not_ removed if you remove them from
those lists! Use the `brew untrust` command to remove a trust entry.
Refer to upstream documentations for more information:
<https://docs.brew.sh/Tap-Trust>
'';
type = types.submodule {
options = {
taps = lib.mkOption {
description = ''
Taps to trust in their entirety.
This should be used with caution. To quote upstream documentation:
> Trust a whole tap only when you are comfortable with all current and
> future formulae, casks and external commands from that tap being loaded
> by Homebrew.
'';
type = types.listOf types.str;
default = [];
example = [
"user/repo"
];
};
formulae = lib.mkOption {
description = ''
Fully-qualified formulae to trust.
'';
type = types.listOf types.str;
default = [];
example = [
"user/repo/formula"
];
};
casks = lib.mkOption {
description = ''
Fully-qualified casks to trust.
'';
type = types.listOf types.str;
default = [];
example = [
"user/repo/cask"
];
};
commands = lib.mkOption {
description = ''
Fully-qualified external commands to trust.
'';
type = types.listOf types.str;
default = [];
example = [
"user/repo/command"
];
};
};
};
default = {};
};
autoMigrate = lib.mkOption {
description = ''
Whether to allow nix-homebrew to automatically migrate existing Homebrew installations.
@@ -30,7 +30,7 @@ if [[ ! -e ".git" ]]; then
exit 1
fi
if ! grep -E "^# Homebrew" "README.md" >/dev/null; then
if ! grep -E "^#.*Homebrew" "README.md" >/dev/null; then
>&2 echo "${PWD} does not looks like a Homebrew checkout"
exit 1
fi