3 ms·
Anyone who's used Nix for a while -- how does package availability compare to Homebrew or Macports? Other than the default.nix thing (which Homebrew also has a
by schneidmaster 10y ago
Anyone who's used Nix for a while -- how does package availability compare to Homebrew or Macports? Other than the default.nix thing (which Homebrew also has a version of [1]) are there any other clear benefits to switching from Homebrew?
[1]: https://robots.thoughtbot.com/brewfile-a-gemfile-but-for-homebrew https://robots.thoughtbot.com/brewfile-a-gemfile-but-for-hom...
- hso1 10y agoFor me the biggest benefit is reproducibility. I can get a package to build on any machine exactly the same and with no hidden dependencies.
- schneidmaster 10y agoThat does seem pretty cool, and I also see it works out-of-the-box on Linux machines. It doesn't seem to have a homebrew-cask equivalent though, which is a bit of a bummer. (Makes sense though since GUI applications aren't really cross-platform.) How does it handle OS-specific dependencies/distinctions? Or if e.g. a package requires ruby or python to be installed?
- hso1 10y agoWe use it on Python projects instead of virtualenv. A problem that you sometimes have with virtualenv is that you must install libpq-dev and python headers and what not to install from pip if the package has native extensions. With Nix you just declare postgresql as your package inputs and you are done. All needed parts to build and install psycopg2 are there. Your package/project is completely isolated from your OS libs.
- sirn 10y agoThe last time I tried (a month ago), I could reproduce most of my current Homebrew packages. There are few that are broken (e.g. rust, which has since been fixed), or do not have Darwin support (aria2c, which I have a PR open[1]). There are also packages that are a little bit hard to discover, e.g. those that are imported from Haskell's Hackage where it is not listed by default[2] when you do `nix-env -i <packageName>` (e.g. shellcheck). From my few days of trying to replace Homebrew with Nix, being able to rollback the environment to last known good state (`nix-env --rollback`), ability to keep track of package changes (`nix-env --list-generations`), ability to try a package without installing it (`nix-shell`, well, technically it's installed on the machine, but nothing is linked in the profile, and you can nuke them with `nix-collect-garbage`) are very nice additions. Apart from these features, the fact that it doesn't chown `/usr/local/` to my user is a big plus. Nix will also not linking anything not explicitly installed by user to their profile (e.g. if package A has B as dependency, B won't be linked until user actually choose to install it, which is then managed separately from B that were explicitly installed as A's dependency). That said, I've since revert back to Homebrew because there are few packages broken that are crucial to what I'm working on. Creating and fixing package is not too hard (I did with aria2c), although time didn't allow me to do it back then. I would love to try to switch to Nix again sometimes. People in ##nix-darwin are super-nice, also! :-) [1]: https://github.com/NixOS/nixpkgs/pull/15029 https://github.com/NixOS/nixpkgs/pull/15029 [2]: https://nixos.org/nixpkgs/manual/#users-guide-to-the-haskell-infrastructure https://nixos.org/nixpkgs/manual/#users-guide-to-the-haskell...
- schneidmaster 10y agoThanks for the review. I think I'll definitely have to give it a try next time I've got a free weekend.
- mitchty 10y agoThe default.nix thing is nothing like what home-brew has. Not really kidding here, nix is like git is to svn. Very different in philosophy. I can setup scripts that install and configure things for emacs to make sure it always runs in an environment that has all it needs. But with the benefit of not having to have everything installed globally. I can have multiple versions of whatever installed into /nix at once. But still not have to worry about breaking things that need both versions. As for package availability, I've not hit any issues. It has most of what I personally need. What I hit more often is random breakage or having to update derivations that only ever got created or maintained from a linux perspective. I'd say its in the "developer not afraid to fix broken build problems" category as a package manager. Its not bad, but it is really annoying when you have to revert back to a prior generation because some package you use got updated and now won't build because of its test suite failing. Random stuff like that happens a few times a month, nothing huge though honestly.
- benley 10y agoI've been able to replace _most_ of what I wanted from homebrew with Nix. I still keep brew around for a few things that haven't been packaged (or packaged properly) for Darwin in nix, like bazel and aptly. Works out pretty well overall.
- zachrose 10y agoYou can browse available Nix packages here: https://github.com/NixOS/nixpkgs/tree/master/pkgs https://github.com/NixOS/nixpkgs/tree/master/pkgs ...and search here if you're looking for something in particular: https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/all-packages.nix https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/...