3 ms·
That seems like a hell of a lot more work than just using Home-Manager and flakes. Flakes add a lot of boilerplate, but this seems excessive in comparison. And
by SAI_Peregrinus 4y ago
That seems like a hell of a lot more work than just using Home-Manager and flakes. Flakes add a lot of boilerplate, but this seems excessive in comparison. And Home-Manager is quite easy.
- qbasic_forever 4y agoYeah this post is basically how to build your own wrapper around nix to manage your Mac user environment because you didn't like some of the decisions the nix maintainers made. It's easier to just install nix following its directions and then exclusively use nix-shell or nix develop (with flakes) to activate development environments with specific tools. Kind of like a python virtual environment on steroids. Forget entirely about managing your user's global tools and packages unless or until you want to do that, you could just keep using homebrew!
- ratorx 4y agoEven managing global/user packages is fine, if you want parity with a normal package manager. nix-env is pretty simple to get started with. Managing that declaratively is slightly more challenging. That’s when you need to understand the Nix language and use something like home-manager or the file approach in the blog post. But at this point, Nix is competing against something like Ansible/Puppet and not a standard package manager.
- pxc 4y agoThis blog post follows IanTheHenry's method for declarative environments via nix-env, which was produced when Ian was following a methodology for learning Nix that deliberately eschewed engagement with the Nix community in favor of relying only on the official documentation. So it doesn't use flakes or any unofficial community tools that could make setup 'easier' in the sense of being a bit more ready-made. Anyway I don't think there's anything really wrong with it. There are also other options for people who are hesitant to try flakes or home-manager if they don't like this one for some reason, though. The most common one is a named package based on buildEnv in your packageOverrides or in an overlay. (There's an example of this on the unofficial NixOS wiki, in the FAQ.) And of course home-manager is usable without flakes.
- viraptor 4y agoThere's nothing wrong with it, but also I think it would be worth making it explicit that things are done the hard way. It's a bit like writing a programming on macos post with "so first we need to craft a xnu message by hand". For people arriving from search that's not a great impression.
- rtpg 4y agoI mean.. it sounds wrong[0]. I don't think flakes are really mandatory given that the status quo is stuff like brew, but home manager actually does "the thing" that Nix people are talking about. Without something like home manager or NixOS, you really are only halfway to what the actual pitch is for nix. (Aside: I can't imagine figuring out how to use nix just from the official documentation. Those documents are a total mismatch from what the audience needs, focusing way too much on how to write your own custom modules, and not nearly enough on actually consuming them or decent patterns for it) [0]: people are allowed to do what they want. But the path chosen by this author is not the easy path
- pxc 4y ago> I mean.. it sounds wrong[0]. I don't think flakes are really mandatory given that the status quo is stuff like brew, but home manager actually does "the thing" that Nix people are talking about. Without something like home manager or NixOS, you really are only halfway to what the actual pitch is for nix I agree— I really like NixOS-like module systems and how they merge together different bits of config to bring the benefits of Nix to configuration management. Being able to configure the whole OS or a big chunk of it via Nix, including running services, managing users, pre-configuring various programs, and more, from a unified interface in a simple language like Nix is awesome. Declarative package management is great but the broader configuration/service management stuff is even better. > Aside: I can't imagine figuring out how to use nix just from the official documentation. That's part of what makes Ian Henry's blog series on the topic compelling! Nobody really learns it that way, and so he's putting the docs to an unusual and much-needed test. Definitely check it out :)
- 4y ago