Skip to content

Homebrew activation fails when casks come from Nix-backed taps: "requires casks to be in a tap" #1791

@QuillVot

Description

@QuillVot

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:
    • nix-darwin
    • nix-homebrew
  • 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

  1. Configure nix-darwin Homebrew integration with nix-homebrew
  2. Provide homebrew/homebrew-cask via flake input
  3. Add casks like:
    • ungoogled-chromium
    • claude-code@latest
    • codex
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions