Live data from Hacker News

Nix as OS X Package Manager

ariya.ofilabs.com

91–100 of 209 posts

Re: Nix as OS X Package Manager

#91

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-hom...

You can browse available Nix packages here:

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/...

Re: Nix as OS X Package Manager

#92
post #60

Why use nix when pkg-src has been available on Darwin for over 15 years, boasts more packages, and has decades of support (plus Jonathan Perkin and the guys over at Joyent)? Why people assume the gross project known as homebrew (and the better macports, where homebrew gets all of their real package patches) are the only two package managers on OS X/Darwin is perplexing to me... Not to say nix is not interesting, but…

Hmm.. I've never tried pkg-src before. I'll give it a try. Step 1: I have to download a gig of stuff before I can install any packages? Even though my drive is big nowadays, that still seems like a bit of a waste... Step 2: Let's try building a package, the last thing I installed with homebrew. > cd math/minisat > make install clean Makefile:27: *** missing separator. Stop. > make Makefile:27: *** missing separator.…

use the `pkgin` binary to install binaries built from joyent... (https://pkgsrc.joyent.com/packages/Darwin/) No need to clone the package tree. This fixes step 1. `sudo bmake install clean` fixes step two.... (opt needs superuser permissions). see the joyent link in particular to see how easy it is to install pre-compiled binary packages with pkgin

Re: Nix as OS X Package Manager

#93
post #86

Earlier quoted context omitted.

Nix groups all of your installed packages in one environment. When you install a new package, it creates a new environment with the new package added to it. This alone may sound insignificant, but it enables having multiple nix environments (e.g. one per project) and switching between them very quickly and easily.

Can you give me an example of projects which require this setup? (Even a personal anecdote will do)

Here is a personal anecdote: Managing multiple versions of openCV on OS X. OpenCV has a long laundry list of dependencies and trying to get two versions to build can be a nightmare. (It's much easier to just update one of your projects to use the same version of OpenCV as the other one.) With Nix each of those OpenCV versions can live completely isolated from each other so their dynamically linked dependencies don't get overridden by each other.

Re: Nix as OS X Package Manager

#94
post #64
post #60

Why use nix when pkg-src has been available on Darwin for over 15 years, boasts more packages, and has decades of support (plus Jonathan Perkin and the guys over at Joyent)? Why people assume the gross project known as homebrew (and the better macports, where homebrew gets all of their real package patches) are the only two package managers on OS X/Darwin is perplexing to me... Not to say nix is not interesting, but…

Both of your links are broken.

oops, copied it over from my comment on the article itself. fixed now

Re: Nix as OS X Package Manager

#95
post #33

Earlier quoted context omitted.

> I wouldn't have known how to reproduce that "working state". So what? You don't need to reproduce that working state: The work has already been done! Think about how the interactive approach Lisp and Smalltalk programmers use is superior to the compile/run/rerun approach used by C++ and Java programmers -- by exploring the problem in a nonlinear way, you can find your way to a solution more quickly. Docker package…

How do you recommend applying security updates to the image, short of running (for example) `apt-get dist-upgrade`? What if that breaks? Do you just continue with the out-of-date image?

There's tools like zypper-docker that make this possible.

Re: Nix as OS X Package Manager

#96
post #41

Is there any reason to switch if homebrew worked perfectly for me in the last couple of years?

none, which is why this article is so vague.

like i needed another folder in root, as if `/opt/`, `/usr/local/` or `~/.local/share` weren't good enough and this is somehow a feature. another package manager that has less features than homebrew? oh, like fink and macports - no thanks.

Re: Nix as OS X Package Manager

#97
post #56

Earlier quoted context omitted.

I mean, that's exactly what a Dockerfile is for. I don't know of anyone seriously using Docker that isn't using Dockerfiles exclusively. I only know of a single time when it's valuable to "commit" a new image (recovering logs from a stopped container). None of which is to detract from Nix. Nix+Docker is a powerful combination. It takes Docker's declarative nature all the way down to the compiler used to build the bit…

The big difference is that nothing about Dockerfiles implies that the processes they perform to build an image are deterministic or repeatable. Will a build step that runs `curl https://github.com/something/whatever` do the same thing in six months that it does today? Docker doesn't help with that at all. Nix improves determinism by (almost) guaranteeing that if you build the same nix expression six months from now,…

YES.

Finally someone understands what really annoys me when I say that docker isn't 100% reproducible if you aren't using version pinning or something similar.

If you have 2 developers, and one of them does a build the next day, you could have them with two different versions of a package when the version went up.

Re: Nix as OS X Package Manager

#98

See you all in five years when Nix is shit and we're all switching to Flurp as our package manager.

"when people thought the earth was flat, they were wrong. When people thought the earth was spherical, they were wrong. But if you think that thinking the earth is spherical is just as wrong as thinking the earth is flat, then your view is wronger than both of them put together." -Asimov

http://chem.tufts.edu/answersinscience/relativityofwrong.htm

Re: Nix as OS X Package Manager

#99

See you all in five years when Nix is shit and we're all switching to Flurp as our package manager.

I ended up searching "Flurp" because with the current state of things, there was a chance that this was real.

Add javascript to the search. Sometimes I do that with random searches just to see the crazy things people are doing with Javascript

Re: Nix as OS X Package Manager

#100

I was forcefully relocated from my comfortable decade-old Debian home into OS X, and the package management here in unsatisfying. I'm looking forward to future posts that show how Nix is better than Homebrew or MacPorts, because that hasn't been demonstrated so far. And as a bikeshed nitpick, I was always unhappy with the meaningless rpm options, preferring apt's clearer options (rpm -qa vs aptitude search). I'm a bi…

"I'm looking forward to future posts that show how Nix is better than Homebrew or MacPorts, because that hasn't been demonstrated so far."

Homebrew is downright dangerous (I've written about why: http://inthebox.webmin.com/homebrew-package-installation-for... ).

MacPorts is fine. Not wonderful, but OK. Not reproducible in the way Nix is.

PkgSrc is also pretty good. Also not reproducible the way Nix is. But, the packaging policies are good, the packages tend to be well-thought out, and the technical solution to stuff like dependency resolution is pretty OK. The people building and maintaining PkgSrc know what they're doing.

Nix is clearly superior to all of them, however, in being reproducible, easy to roll-back in a predictable way (try going backward with almost any other package manager, even RPM/yum and dpkg/apt can't do that...I love'em both, but recognize that we now have better solutions to package management). Nix is just a fundamentally better tool.

Flatpak is another really promising packaging technology with some of the same benefits (but it's tackling things in a different way; I think I still have to consider Nix a better overall solution; it is certainly simpler in both implementation and usage, for packagers/developers and end users).

But, don't use Homebrew. For now, PkgSrc is probably the best method of getting a lot of reasonably good packages for Mac OS X. Nix will be the better option eventually, once there's a lot of people packaging for it (assuming people get over their bizarre love affair with Homebrew and start working with Nix, instead).

Post reply on HN