11 ms·
My Experience with Nix on OS X
- defiancedigital 10y agoRedesign of nix command line is a good thing. Nix should be more intuitive. I totally agree that nix is the future of package management.
- nikolay 10y agoMany of the nix switches and commands are non-intuitive. I always have to check the man page, and I'm more often than not surprised by their choices!
- mitchty 10y agoThey're patterned after rpm generally.
- nikolay 10y agoWhich is a poor choice! Picking yum or apt as the model would have been a saner choice! I feel the same way dealing with Arch Linux - being different (read "weird") isn't always better!
- hk__2 10y ago> being different (read "weird") isn't always better! To go further, being different is almost always a bad idea. People are used to how current stuff works; you need a really good reason not to provide the same interface.
- mitchty 10y agoSure but its not different/weird. I've used rpm for a long time, using nix was more, oh ok so rpm type flags no big deal. It is weird mostly due to exposure to other tools. IIRC nix started out over 10 years ago, well before apt or yum became very widely used.
- nikolay 10y agoRPM-based distros are not the most popular, though [0]! [0]: http://distrowatch.com/ http://distrowatch.com/
- mitchty 10y agoSure, now, but was that the case 10 years ago? I'm not arguing its the best choice but more that you need to take into account the age of things. Being exposed to it just now doesn't mean it was created in that situation. I'd say 10 years ago rpm based distributions were the more dominant and emulating rpm was a fine choice.
- paperpunk 10y agoWhat makes Nix the future of package management? I'm not familiar with it so I don't know! I looked at the web-site and didn't find it clear what it does that Homebrew doesn't, other than being cross-platform (although I recently started using Linuxbrew which has made Homebrew cross-platform-ish for me).
- chaosfox 10y agoread this: https://nixos.org/nix/about.html https://nixos.org/nix/about.html I don't know if it is "the future", but it has features that would be very welcome in other package managers.
- sirn 10y agoThe power of Nix start when you start building your own ~/.nixpkgs/default.nix (but you don't really need to if you don't want to): { packageOverrides = pkgs: with pkgs; rec { all = buildEnv { name = "all"; paths = [ vim fish gitAndTools.gitFull ]; }; }; } This is the Nix package collection. You can install this package with `nix-env -i all`. What does it do? Install vim, install fish, install git. Not much, and easily doable in Homebrew in much fewer keystrokes. Now imagine you decided that you don't like vim and want to go with emacs. You change the paths to `paths = [ emacs fish gitAndTools.gitFull ]`. Run `nix-env -i all` again. What does it do now? It uninstall vim and install emacs. Now that you decided you don't like emacs after all and want to go back to vim. You can just run `nix-env --rollback` and it will happily rollback the change it made to the filesystem made by latest nix-env call, as in, restoring vim at where you expect it to be. This is the declarative nature of Nix. You declare the state you want the package to be (or the whole system, in case of NixOS) and Nix will figure out how to get to that state. default.nix can also do a lot more things, for example, adding custom packages, overriding versions, changing build flags and much more. Let's say one day you need to clone the whole setup to other machine, you only need to copy this default.nix and run `nix-env -i all` on that machine and everything is reproduced in the way you expected. This default.nix can also be per-project, allowing collaborators to share the same packages (and custom packages).
- 10y ago
- nextos 10y agoI found Guix ones more understandable. Also Guix switch challenge is incredible from a security perspective: https://www.gnu.org/software/guix/manual/html_node/Invoking-guix-challenge.html https://www.gnu.org/software/guix/manual/html_node/Invoking-... Nix should take those things back. Overall, it's a great package manager.
- rokgarbas 10y agoa redesign of nix command line is on the way. so thins should get easier.
- k__ 10y agohow long will this take?
- renox 10y ago>I totally agree that nix is the future of package management. Perhaps, if they clean it up significantly, I think that nix's principles are very sound, but the implementation isn't: it's fine when you are using it as a simple package manager but as soon as you want to do something a bit complex (say building gcc with a different kernel version) you're on your own: 1) half of the documentation makes reference to configuration files which aren't in my version of nix?? 2) there is no real mail/news forum for support/help: no IRC isn't enough.
- ris 10y agoI'm guessing one of the major reasons more packages are "broken" for macos is there is a CI system running for linux/nixos (travis) and not one for macos. So macos breakages can slip in easily. If a passionate mac advocate wanted to take on the responsibility of setting up & running a CI machine and hooking it up to the github PRs, I can only imagine it being a good thing...
- _query 10y agoGood suggestion. Looks like travis already has an OS X build environment[0]. So technically it should be doable :) [0]: https://docs.travis-ci.com/user/osx-ci-environment/ https://docs.travis-ci.com/user/osx-ci-environment/
- hk__2 10y agoYes Travis CI supports OS X and we used it for a while for Homebrew.
- Ericson2314 10y agoThe real solution is we need to use our CI, Hydra, to build all PRs. Now Travis doing this is interesting because last time people looked there was no hosting for OS X that wasn't ridiculously expensive, so we've literally had people donate Mac Minis.
- rokgarbas 10y agothe major reason for poor package support is low number of osx users (hydra - nix build farm - builds binaries also for osx).
- CJefferson 10y agoI've started looking at this. Part of the problem is that nix wants (reasonably) to do "everything itself", including (for example) bundling the OS X SDKs itself. At the moment that's broken (the 10.9 SDK is installed in 10.11, then links against some 10.11 libraries, which is blocking mplayer). I don't have the knowledge to fix it. homebrew and fink have had the same problem (deciding when to link against system libraries and when to try to rebuild) -- hopefully nix will get over this hurdle.
- aeosynth 10y agoNix is not great for casual Linux desktop usage - I tried installing the Atom editor, and cancelled when I saw X11 being downloaded. You might as well run NixOS in a VM.
- frio 10y agoHow would you run Atom on a Linux desktop without X11? Honest question; I didn't think Wayland/Weston were far enough along yet...
- vetinari 10y agoHe probably already had X11 installed and Nix was downloading duplicate libs.
- davexunit 10y agoThis is a feature. Nix is completely isolated from the host system. It manages its own dependency tree. Using libs and other things from the host system would be both brittle and nondeterministic, negating the reason why Nix is so novel in the first place.
- aeosynth 10y ago... except on OSX. Really I just wanted something to take the place of an Arch Linux AUR helper, the way Nix replaces Homebrew.
- frio 10y agoAh, I can understand the concern on OSX (or other Linux distros). Earlier in the chain, you wrote "Linux desktop" -- which, to me, implied using NixOS :).
- cm3 10y agoWayland and Weston work and there's also non-Weston compositors (window managers) like sway, kwin, gnome and more that actually work decently enough with Xwayland integration for running legacy (X11) apps.
- kevincox 10y agoI've never used Nix for OS X, but I can confirm that the UI can definitely use some work, and the proposed changed which are in the pipe look fantastic. But, comparing Nix on the simple operations is like reviewing a sports car after only driving it in a school zone. There is so much more that Nix provides that homebrew doesn't even come close to. Nix has made managing of my servers way easier then anything I have tried before and I have no intentions of changing away any time soon.
- izacus 10y agoWhich of these features would be useful on a desktop machine used for development? I'm genuinely curious, I don't really use homebrew either since most of the stuff I need is already installed.
- Ericson2314 10y agoCross-platform isolated development environments per project. Bye-bye Vagrant!
- kevincox 10y agoI haven't used Nix much on the desktop as a "user" so I'll just say some things about development. It basically boils down to one thing: isolation. Everything you use will be described by Nix, no system libraries or commands. The only think you rely on is the kernel of the host. Not only is my environment almost exactly the same from development to CI to deployment but I can actually copy the program exactly as it was built between them (assuming compatible kernel and architecture). For example when I push to my master branch CI automatically runs a build, tests the code with the exact versions of the libraries it will be using in production then uploads them to a binary cache (which is essentially the nix equivalent of a package server), Now I can just install the program on my production servers and it will use the exact versions of the libraries that I tested it with with almost no reliance on the underlying system. It's like docker but simpler and more elegant.
- Nullabillity 10y ago
- nixos 10y agoWhat do people do about packages being old? Many of their front facing server packages are not being updated. Presumably, they have quite a few security issues in them
- vertex-four 10y agoUpdating packages is generally easy and takes 10 minutes of your time (including sending a pull request) once you've figured out how it works. Please do so if you're a NixOS user - NixOS has far, far fewer people working on it than, say, Debian.
- res0nat0r 10y agoNix looks cool on OSX, but trying to install something like elixir from scratch involves my macbook air compiling packages for at least 40+ minutes before I ctrl-break which is a no go. I thought Gentoo was cool in the early 2000s when I didn't do sysadmin work for my job. I'm not waiting an hour or two to install a package anymore. I'm sure this will improve when more precompiled packages are released for OSX when it is more popular.
- aidenn0 10y agoMy understanding is this is at least partly because of a lack of mac build machines for hydra.
- iElectric2 10y agoDisclaimer: Nix(OS) developer, I am biased. It's very important for us to get such feedback. This allows us to improve and move forward. In Nix defense I think it's not worth comparing stability yet, although that is the most important aspect for users. What matters currently is how many smart people grasp the idea why we're fundamentally better by architecturing the language and packaging problem itself and any help we get to move us forward. For fair comparison you should note that we have ~800 contributors, probably more than 90% are on Linux. Meanwhile Homebrew packages have almost 6000 contributors. We have recently added 4 macs to our build farm at http://hydra.nixos.org/machines http://hydra.nixos.org/machines, but we desperately need more developers that care. Not 6000, just a few more.
- CJefferson 10y agoIs there an easy overview page to see packages which are failing to build on Mac, maybe even with a link to the failing build output?
- novembermike 10y agoI played around with it and ended up getting rid of it for basically the same reasons, but I have to say that I was impressed by how easy it was to remove. When I got rid of Homebrew I had to run a script that did a bunch of non-obvious things, when I got rid of Nix I did rm -rf /nix && rm -rf ~/nix-* and removed a line from my zshrc. My main complaint with Nix itself was that Vim was built without python support so Youcompleteme didn't work and it wasn't obvious how to recompile it to have python support, but the experience was nice enough that I'll give it another go later on.