Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Homebrew Formulae to config #108

Closed
gjolund opened this issue Aug 15, 2024 · 4 comments
Closed

Add Homebrew Formulae to config #108

gjolund opened this issue Aug 15, 2024 · 4 comments

Comments

@gjolund
Copy link

gjolund commented Aug 15, 2024

I tried adding homebrew formulae to the config in the same way as you added the casks but it keeps throwing errors, that is the recommended way to manage homebrew formulae in this fashion?

https://mynixos.com/nix-darwin/option/homebrew.brews

  homebrew = {
    enable = true;
    brews = pkgs.callPackage ./brews.nix {};
    casks = pkgs.callPackage ./casks.nix {};
    onActivation = {
      cleanup = "zap";
    };
}:

brews.nix

_:

[
  # Development Tools
  "stripe/stripe-cli/stripe"
]
@dustinlyons
Copy link
Owner

All I do is look up the formula here: https://formulae.brew.sh/cask/
and add whatever is found to this list: https://github.com/dustinlyons/nixos-config/blob/main/modules/darwin/casks.nix

In your case, stripe-cli is just stripe-cli, not stripe/stripe-cli/stripe.

This is all managed by homebrew here:

casks = pkgs.callPackage ./casks.nix {};

@gjolund
Copy link
Author

gjolund commented Aug 19, 2024

All I do is look up the formula here: https://formulae.brew.sh/cask/ and add whatever is found to this list: https://github.com/dustinlyons/nixos-config/blob/main/modules/darwin/casks.nix

In your case, stripe-cli is just stripe-cli, not stripe/stripe-cli/stripe.

This is all managed by homebrew here:

casks = pkgs.callPackage ./casks.nix {};

This works for casks, but the stripe-cli is distributed as a brew formulae and is not a cask.

typically it is installed via brew install stripe-cli and not brew install --cask stripe-cli.

this is why I was trying to add the brews.nix declaration file.

@dustinlyons
Copy link
Owner

dustinlyons commented Aug 28, 2024

This configuration doesn't currently support brew formula, only casks. This is because brew formula essentially does what the nix package manager does-- install packages. But brew is imperative, nix is declarative.

You should search here for your packages instead:

https://search.nixos.org/packages?channel=24.05&show=stripe-cli&from=0&size=50&sort=relevance&type=packages&query=stripe

and add to packages.nix.

In this configuration, brew is only used for macOS apps that do not belong in nixpkgs, so you can install casks.

@gjolund
Copy link
Author

gjolund commented Aug 30, 2024

This configuration doesn't currently support brew formula, only casks. This is because brew formula essentially does what the nix package manager does-- install packages. But brew is imperative, nix is declarative.

You should search here for your packages instead:

https://search.nixos.org/packages?channel=24.05&show=stripe-cli&from=0&size=50&sort=relevance&type=packages&query=stripe

and add to packages.nix.

In this configuration, brew is only used for macOS apps that do not belong in nixpkgs, so you can install casks.

ok that makes sense, thank you for the explanation

@gjolund gjolund closed this as completed Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants