-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Homebrew recipe for nix #6841
Comments
I checked with a community member who's fairly familiar with Homebrew about this. I'll try to ~summarize:
They mentioned a "classic" approach where you'd install the formula but still have to run a script to complete the install (if I understood right, the formula would just be installing the installer--sounds like this wouldn't really satisfy your concern). This would be nice, but I hesitate to encourage anyone to invest a lot of time in it unless someone familiar with both Nix and Homebrew is attesting to the feasibility. (To be clear, I'm not really a decider here--just someone who asked around and reported back.) |
That sounds right. Installation via Homebrew wouldn't really simplify anything: whatever the Nix installer currently does, the Homebrew recipe would have to do as well. Also, Nix is largely an alternative to Homebrew on macOS, so installing via Homebrew just sounds like it adds unnecessary complexity. |
Thanks @abathur for checking this. I think that's all I can ask for at this moment. @edolstra I know it's an 'alternative' but for me at this point it's not really an alternative yet. This would make the adoption path more smooth. Also I'd question all of the really funky stuff that Nix plans to do to my macOS system which I would reject always. That's been a similar reason why before homebrew I for instance never used things like macports either. |
I'm reading the manual and trying to figure this out. Nix does pretty much the same thing as Homebrew as you say above. But why does |
The build sandbox requires the nixbld users so that you can build in parallel in isolation. The nix store path is hardcoded to one location because it gets hardcoded inside of the packages. Also it requires special mounting to be read only for the normal users. |
AIUI you're looking for multiple ~contextual justifications...
|
I don't see this in the documentation. The documentation only implies that it will do a certain amount of violence to my system that will be arbitrarily difficult to undo. (Same reason I never used stuff like Macports.) |
Yeah, it turns out single-user is no longer supported for macOS. Sounds like it would be ideal.
I think it's a bit weird to hardcode in a root folder if |
As I said:
Do you think calling it weird will change it? This was relitigated repeatedly in #2925 (which you participated in). And again:
|
(Funny, totally forgot about that.) What else would change it? I'm just saying that this way, Nix for me is the same as Macports/Darwin was, a non-starter until Homebrew appeared. Usually my reaction on these things is relatively correct and I'm sure that this is holding up a lot of adoption of Nix on macOS (which is a shame). |
As 2925 illustrates, this isn't a unique perspective. There are plenty of people (myself included) who'd prefer not having to swim against the flow, here. But (for the reasons I listed among others) it isn't trivial to change a ~20-year-old default that is (for now) fundamental to the public caches that make nix/nixpkgs practical for everyday users. I don't have the high-level perspective to know (perhaps someone else will weigh in), but my ~guess is that it's down one of two paths:
|
Thanks, I'll read up on that at some point though for my current knowledge level it seems a bit over my head. I found another person saying the same thing: https://ianthehenry.com/posts/how-to-learn-nix/flakes/
|
Piggybacking on this issue since I was looking for the opposite and Google led me here. Nix-darwin provides a way to install packages and casks through homebrew, but does not provide a recipe to install homebrew itself. Do you think it would be doable? I can open a new issue related to this if needed. |
@mtreca You could technically make a nix package for brew itself (I found at least one out there in cask2nix: https://github.com/matthewbauer/cask2nix/blob/9590b51cdc5b32da715ecf06fdc7aaae1b6f19b9/cask2nix.nix), but that won't handle creating all of the directories outside of /nix/store that homebrew expects to be able to write to. nix-darwin could support installing homebrew through the brew module's activation script, but it looks like they made a conscious choice to exclude it from the initial PR: LnL7/nix-darwin#262 (comment) I won't sanction a specific one since I don't do this myself and haven't tried any of these, but I found several examples of individuals that are either building a shell, using their own brew module, or adding extra/user activation scripts that do install it: https://github.com/search?q=language%3Anix+%22homebrew%2Finstall%22&type=Code |
I am releasing packages on homebrew and I want to test the installation from nix; Want this! |
Is your feature request related to a problem? Please describe.
I find the installation and uninstallation instructions for nix on macOS to be intimidating and complicated. I'd like to try nix but I don't see myself going through the steps listed on the website for a benefit which to me at the moment is still uncertain.
Describe the solution you'd like
Looking through the issues here it seems a lot of people are running homebrew already for their dev dependencies. If homebrew is part of the system, then might it not make sense to also provide nix as part of homebrew?
So: Can we have nix on macOS as a homebrew recipe for ease of installation and uninstallation?
Describe alternatives you've considered
No real alternatives. I use homebrew for all my developer tools already and will refuse to use tools if they are not provided through homebrew.
The text was updated successfully, but these errors were encountered: