malob / nixpkgs

My Nix system configs!
MIT License
403 stars 34 forks source link

homebrew installation? #12

Closed jmatsushita closed 2 years ago

jmatsushita commented 2 years ago

Hi Malob,

Thanks a ton for the great nix-darwin configuration, I've been using it to write a very simple how to for M1 Macs https://discourse.nixos.org/t/simple-workable-config-for-m1-macbook-pro-monterey-12-0-1-with-nix-flakes-nix-darwin-and-home-manager/16834

I'm now looking at the homebrew aspect of your config, and I just wanted to confirm that there is not way as of yet to install homebrew using nix? It seems that the homebrew module and homebrew.enable = true expect homebrew to have been installed manually? Is that right?

Cheers,

Jun

jmatsushita commented 2 years ago

After installing homebrew via the official brew.sh installation (I couldn't find it in nixpkgs), nix doesn't seem to find it:

Homebrew bundle...
error: Homebrew is not installed, skipping...

However, running brew bundle manually, seems to pick up the config files generated and install the desired applications correctly.

jmatsushita commented 2 years ago

I see. I seem to have hit https://github.com/LnL7/nix-darwin/issues/321

Using in my nix-darwin configuration works.

brewPrefix = "/opt/homebrew/bin";

In addition, it seems that the expectation is indeed to install homebrew manually, so that answers my question I think.

malob commented 2 years ago

Thanks for the kind words re my config :)

Regarding Homebrew, sounds like you figured it out. I think you may also need something like this (I did at least): https://github.com/malob/nixpkgs/blob/f3d18860abca6f7d943a660cb7d9279a978a0b89/darwin/homebrew.nix#L9-L11

If all goes well I think PR’s to nix-darwin will make all of this automatic soon.