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.

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

        1. 6

          Woo! Excited to see some Nix stuff being mentioned.

          I had been running NixOS on my work Macbook for a while, but due to issues with a mix of HiDPI & non HiDPI displays on Linux - I went back to macOS.

          With a new found love though, I was delighted to find out about nix-darwin - LnL has always been really friendly and helpful on #nixos, when I had questions about achieving something with it.

          As such, here’s my collection of expressions that declare the system configuration I use across my macOS machines: https://github.com/cmacrae/.nixpkgs

          I’d certainly consider myself an absolute novice, but as you can see - even with little experience you can cobble something fairly comprehensive together.

          My next plans are formed around my home infrastructure. Currently, I have a little rack - with one shelf occupied by a little Joyent Triton cluster made up of 3 intel NUCs. On top of Triton I run a number of home media services which are in lx-branded OS containers. Right now, I’ve formed a workflow around Packer, Ansible, and Terraform for creating images and deploying services.

          I’m planning to introduce NixOS as a base lx-branded OS image, which you could then “inject” Nix system expressions into for declarative, reproducible images for varying deployments and services.

          1. 2

            I find nix-darwin and your nixPGS for macOS really interesting. I want to try it out, but am pretty much non-nix smart.

            I’ve just ordered a new MacBook, and will need to move everything over.
            Is there a way to take your existing configuration and put it into nix-darwin?

            Is there an idiot’s guide to getting started and making this all work somewhere?

            How do I know the name of the variables I can set?

            Keyboard

            system.keyboard = { enableKeyMapping = true; remapCapsLockToControl = true; };

            this is awesome, but how could I have figured it out except seeing it in your config?

            I’m not exactly an idiot, but around nix, I definitely am :)

            1. 4

              I’m afraid there’s no good answer to that at the moment, I should probably look into how nixos builds the configuration.nix manpage. Currently you’ll need to use the darwin-option command or look at the sources.

              1. 3

                Hey, I’m pretty much non-nix smart too!

                The only means of taking your existing config and putting it into nix-darwin is to express it yourself.

                The NixOS manual and Nixpkgs manual are the best resources for learning.

                Regarding knowing the expressions you can use, I’ve found it’s a combination of what you learn from the NixOS manual and digging through the available modules in nix-darwin. It’s pretty easy to understand what’s possible with these when reading them. Nix is pretty verbose, so it should be clear what values you can/cannot pass to module parameters.

                On top of that, you also have my config to go on! And LnL has an ‘examples’ directory in the ‘modules’ part of nix-darwin that you may also be able to learn a bit from.

                1. 2

                  Poking me on irc is also an option, I’m happy to answer any questions you have. As for things that are not supported yet feature requests or contributions are very welcome.