Summary
darwin-rebuild switch fails during Homebrew activation because brew bundle rejects some casks when the Homebrew tap content is supplied through a Nix-backed nix-homebrew setup.
The failure aborts activation completely.
Environment
- macOS: Apple Silicon macOS
- Homebrew prefix:
/opt/homebrew
- Using:
- Homebrew activation is managed by the
homebrew module in nix-darwin
homebrew/homebrew-cask is provided through flake-pinned Nix inputs
Relevant setup
The setup is conceptually:
nix-homebrew = {
enable = true;
user = username;
taps = {
"homebrew/homebrew-core" = homebrew-core;
"homebrew/homebrew-cask" = homebrew-cask;
};
mutableTaps = true;
};
homebrew = {
enable = true;
taps = builtins.attrNames config.nix-homebrew.taps;
casks = [
"ungoogled-chromium"
"claude-code@latest"
"codex"
];
};
Reproduction
- Configure
nix-darwin Homebrew integration with nix-homebrew
- Provide
homebrew/homebrew-cask via flake input
- Add casks like:
ungoogled-chromium
claude-code@latest
codex
- Run:
sudo darwin-rebuild switch --flake .#<host>
Actual behavior
Activation fails at the Homebrew Bundle step:
Homebrew bundle...
Fetching ungoogled-chromium, claude-code@latest, codex
Fetching: ungoogled-chromium, claude-code@latest, codex
Error: Homebrew requires casks to be in a tap, rejecting:
/opt/homebrew/Library/Taps/homebrew/homebrew-cask/Casks/u/ungoogled-chromium.rb (/nix/store/...-source/Casks/u/ungoogled-chromium.rb)
`brew bundle` failed! Failed to fetch ungoogled-chromium, claude-code@latest, codex
Because this happens inside activation, the whole darwin-rebuild switch fails.
Expected behavior
If nix-darwin supports Homebrew activation in combination with nix-homebrew, activation should either:
- succeed with these taps/casks, or
- provide a supported configuration path that avoids this failure mode, or
- avoid letting this kind of cask incompatibility abort the entire rebuild without a clearer compatibility boundary
Notes
- The casks themselves still exist in Homebrew:
brew info --cask ungoogled-chromium works
brew info --cask claude-code@latest works
- Removing those casks from the declarative
homebrew.casks list allows rebuild to complete.
- So the breakage is not that the casks disappeared, but that
brew bundle rejects the way the cask tap is presented during activation.
Why I’m filing this here too
The root cause may ultimately belong in nix-homebrew integration, but from the nix-darwin user perspective this is an end-to-end activation failure in the homebrew module.
It would be helpful if nix-darwin could either:
- document this incompatibility explicitly,
- provide a safer integration path,
- or point users toward the supported pattern for casks that are not compatible with Nix-backed tap materialization.
Workaround
Current workaround is to remove affected casks from declarative Homebrew management and install them manually via Homebrew. That restores successful rebuilds, but loses declarative management for those apps.
Summary
darwin-rebuild switchfails during Homebrew activation becausebrew bundlerejects some casks when the Homebrew tap content is supplied through a Nix-backednix-homebrewsetup.The failure aborts activation completely.
Environment
/opt/homebrewnix-darwinnix-homebrewhomebrewmodule innix-darwinhomebrew/homebrew-caskis provided through flake-pinned Nix inputsRelevant setup
The setup is conceptually:
Reproduction
nix-darwinHomebrew integration withnix-homebrewhomebrew/homebrew-caskvia flake inputungoogled-chromiumclaude-code@latestcodexsudo darwin-rebuild switch --flake .#<host>Actual behavior
Activation fails at the Homebrew Bundle step:
Because this happens inside activation, the whole
darwin-rebuild switchfails.Expected behavior
If
nix-darwinsupports Homebrew activation in combination withnix-homebrew, activation should either:Notes
brew info --cask ungoogled-chromiumworksbrew info --cask claude-code@latestworkshomebrew.caskslist allows rebuild to complete.brew bundlerejects the way the cask tap is presented during activation.Why I’m filing this here too
The root cause may ultimately belong in
nix-homebrewintegration, but from thenix-darwinuser perspective this is an end-to-end activation failure in thehomebrewmodule.It would be helpful if
nix-darwincould either:Workaround
Current workaround is to remove affected casks from declarative Homebrew management and install them manually via Homebrew. That restores successful rebuilds, but loses declarative management for those apps.