1. 36
  1.  

  2. 17

    I have only recently started using Nix and NixOS (about two months ago). It’s one of those experiences where you are completely oblivious to something’s existence, but once you know it you wonder how you could have ever lived without. I started trying NixOS because of atomic updates/rollbacks and declarative system configuration, but discovered so many other nice features:

    • home-manager for declaratively managing your home directory with atomic updates/rollbacks.
    • nix-shell, which is like pyenv/rbenv/virtualenv but for any library/program in nixpkgs.
    • direnv + default.nix: automatically switch to environments by entering a directory.
    • An enormous number of up-to-date packages: https://repology.org/repository/nix_unstable
    • It is really easy to extend the package collection locally with overlays.
    • A really nice community: I encountered glitches with some packages. I tried to fix them, made pull requests. Received constructive feedback and generally polished changes are accepted within a couple of hours.
    • Support for (encrypted) ZFS on root.

    On my Linux machine, I now have a very slim NixOS installation with GNOME/Wayland and I install/manage the rest with home-manager. On my MacBook I now also use home-manager. My next project is to try nix-darwin (thanks @LnL7).

    (Jumping in does require some investment of time though.)

    1. 7

      OK, I’m intrigued. Is there a beginners “Homebrew to Nix” guide anywhere that you can recommend? I regularly have breakages with home-brew, particularly with ruby and python tools. I regularly have to re-create my virtualenvs because the underlying python binary went away. This is vexing.

      1. 2

        I’m afraid there’s not a great answer. Things like the apt cheatsheet on the wiki and nix by example might be a good starting point. And then there’s the nix pills, which are great but pretty technical, but other than those and what’s documented in the manual/wiki it does require a bit of figuring things out on your own.

        The community is pretty active and there are a lot of helpful people on IRC/discourse that will answer questions and try to help if you run into problems. If you decide to give it a try.

        1. 1

          I gave it a try, migrating more and more to nix before fully removing last usages of Homebrew last night. I mostly did it by trial and error rather than those resources though… I didn’t find it particularly hard. The biggest issue was probably that I built Emacs 27 from git with home-brew, but ended up using the Emacs 26 Mac port, which meant I had to rewrite part of my config since the package.el initialisation has changed a bit.

          I know I’m barely scratching the surface, and haven’t done any customisations at all, but I’m pleased with the switch so far.

        2. 1

          That “underlying Python binary went away problem” with Homebrew gets me all the time too.

          I’ve similarly been curious about Nix for a long time, and am hoping to give it a try soon. I’ll probably test it on my server before my laptop though.

        3. 4

          Happy to see that single-user mode is now the default on macOS. This means I won’t have to de-multi-user my nix installs anymore: https://gist.github.com/ehamberg/68ff4615f95c1acec8e7b6d83196d2b2 :)

          1. 3

            There are a number of benefits to using the daemon, even on a machine with one user. While I personally think it’s important that the default installation method is easy and straightforward for new users. Anybody how’s serious about nix and uses it for more than just installing cached builds from nixpkgs should probably be using the daemon.

          2. 3

            Great news. We upgraded our 16.03 package based nix deployment to 18.03 and nix 2.X series. That was a surprisingly easy task given our installer complexity and nix usage.