The best way to use Nix in MacOS is through qemu and utm in my opinion. Then again, I don't like much about macs except the touchpad and macOS annoys me. So this advice might not hold as true if you actually like OSX. Maybe checkout: https://github.com/LnL7/nix-darwin I'd also advice using flakes to simplify a lot of this.
Using Nix on macOS
31–40 of 116 posts
Re: Using Nix on macOS
#32That 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.
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.
Re: Using Nix on macOS
#33There is absolutely no way I can recommend using this at work. Nix is way too complicated. Its already bad enough being the git goto person. Nix is so complicated it somehow makes git look simple.
I completely disagree. It took me a while to work through the peculiarities of NixOS and get my OS setup, but the benefits are immense now that I'm using it. And I'm using it as a daily driver at a large tech company developing and maintaining mission critical systems. It's really no different from Vim in this respect. Most people will bounce off due to the learning curve, but once you get past it, the benefits are t…
Re: Using Nix on macOS
#34Why hasn’t anyone built a clone of npm/npx UX that uses Nix under the hood? I hear so much about how ideal the Nix model is, and how bad NPM is. It seems like this should be “easy”. What gives?
> Files inside node_modules are cloned or hard linked from a single content-addressable storage
Also (IIRC, it's been a long while) it's lockfile contains enough information to translate it directly to a Nix derivation[1].
[0]: https://pnpm.io/ [1]: https://github.com/nix-community/pnpm2nix
Re: Using Nix on macOS
#35Christ that's a lot of work, just to start working on work. I really want to like Nix, but the UX is frankly offputting. I really hope it improves to the point that it can be mindlessly installed.
Totally, this post is doing a disservice to Nix.
> here, paste this into your terminal for the easiest way to get up and running with Nix in a fashion that's representative of community common practices
I think it's a good blog post which, carefully read, teaches lots of useful things about Nix in a pretty concise way.
It's totally fair to point out that this doesn't represent a path of least resistance to enjoying the benefits of Nix. But I don't love the way your short comment kinda frames the blog post's job as doing something for Nix, either, you know?
I don't like the idea of this guy or anyone else feeling punished or chastised when their Nix-related blog posts become visible because those posts don't function as good marketing for Nix. Having a post about your Nix journey blow up should yield encouraging responses from fellow Nix users, right?
Re: Using Nix on macOS
#36Why hasn’t anyone built a clone of npm/npx UX that uses Nix under the hood? I hear so much about how ideal the Nix model is, and how bad NPM is. It seems like this should be “easy”. What gives?
Have you seen pnpm[0]? Has some similarities. > Files inside node_modules are cloned or hard linked from a single content-addressable storage Also (IIRC, it's been a long while) it's lockfile contains enough information to translate it directly to a Nix derivation[1]. [0]: https://pnpm.io/ [1]: https://github.com/nix-community/pnpm2nix
(I misread their comment the same way as you did the first time :)
Re: Using Nix on macOS
#37This post focused solely on the Nix package manager and Nix packages - for anyone that uses MacOS but is interesting in trying NixOS (or using it within a VM in MacOS), I definitely recommend Mitchell Hashimoto's NixOS repo: https://github.com/mitchellh/nixos-config Honestly, doing that may be easier and a better option than using Nix packages in MacOS.
NixOS is pretty great too, but there's no need to run a VM to use it. NixOS generally solves OS problems. Adding a VM just adds complexity.
Re: Using Nix on macOS
#38This post focused solely on the Nix package manager and Nix packages - for anyone that uses MacOS but is interesting in trying NixOS (or using it within a VM in MacOS), I definitely recommend Mitchell Hashimoto's NixOS repo: https://github.com/mitchellh/nixos-config Honestly, doing that may be easier and a better option than using Nix packages in MacOS.
Nix on MacOS is fine. I've actually experienced less stability running VMs and Docker than I have with Nix on MacOS. nix-darwin is the missing piece of the puzzle, providing NixOS-like functionality. NixOS is pretty great too, but there's no need to run a VM to use it. NixOS generally solves OS problems. Adding a VM just adds complexity.
Re: Using Nix on macOS
#39Earlier quoted context omitted.
I would naively expect that if you run garbage collection on a regular basis that it should take no more space. Is that not true, or is running it on a regular basis the sticking bit?
I suppose you could , but Nix (and NixOS) defaults to keeping packages for an insane amount of time. 3 months of regular Nix use can accrue ~300gb of packages, which is definitely not what you'd have on something like Homebrew.
Re: Using Nix on macOS
#40Earlier quoted context omitted.
I would naively expect that if you run garbage collection on a regular basis that it should take no more space. Is that not true, or is running it on a regular basis the sticking bit?
I suppose you could , but Nix (and NixOS) defaults to keeping packages for an insane amount of time. 3 months of regular Nix use can accrue ~300gb of packages, which is definitely not what you'd have on something like Homebrew.