dustinlyons / nixos-config

General purpose Nix configuration for macOS / NixOS with starter templates + step-by-step guides ✨
BSD 3-Clause "New" or "Revised" License
1.44k stars 91 forks source link

Ability to install Homebrew formula? #90

Closed victorhooi closed 2 months ago

victorhooi commented 3 months ago

I know that you can install Homebrew casks in your template by editing modules/darwin/casks.nix.

And for adding Homebrew taps, I assume you would edit the taps section under the nix-homebrew configuration:

https://github.com/dustinlyons/nixos-config/blob/ce63cb817737d402a486cc3fe79477141b4b4d4c/flake.nix#L101

(Let me know if that's not the correct way we should we adding taps).

However, if we want to add Homebrew formula, is that something you can/should do? Or is is recommended against, or being some kind of Nix anti-pattern?

As in, I noticed there's no file (like there is for Casks) where you can add them, nor is that stanza defined anywhere.

(The context for this is - I'm trying to install JupyterLab - and using the Nix package for Jupyter simply doesn't seem to work for me (context) - so I figured a stopgap/escape-hatch would be to simply install it from Homebrew for now).

dustinlyons commented 3 months ago

The templates don't currently have configuration for Homebrew formula, but nothing is stopping you from adding your own. Generally, the preference is to use Nix (or a Nix overlay) if you want to install a package on your machine. For Mac apps, that's not really possible, so we use casks/Mac App Store apps there.