I switched my primary dev environment to NixOS in a graphical VM on macOS towards the end of 2020 and I love it: https://twitter.com/mitchellh/status/1346136404682625024?s=2...

Previously, I used Nix on Mac (as this blog post suggests) but I had enough “gotchas” with Nix on Mac that I decided to go full NixOS.

For those who ask why a VM or why I keep Mac around at all: I like macOS for everything else besides dev work. I use iMessages heavily, I like the Mac App ecosystem such as calendars, mail clients, etc. This gives me the best of both worlds.

I usually run this on an iMac Pro but also have a MacBook Pro. It runs great on either. It’s also really nice with Nix to update one machine and the other is just one command away from being equivalent.

I recognize this is a “weird” setup but wanted to point it out since it seems relevant to this post.

I love how your reply (which mentions that you use NixOS) is at the top because it indirectly confirms my experience with Nix. I tried Nix on Debian only a couple of weeks ago, and the main issue I had with Nix was that whenever I searched for an answer or other info relating to Nix, most of what I found was written by users of NixOS, not standalone Nix. It seemed that the overwhelming majority of people sharing info about Nix are users of NixOS.

For example, notice how there are 4-5 times as many results when searching the web for "configuration.nix" (which is used with NixOS) than there are when searching for "config.nix" (which is used with standalone Nix):

https://www.google.com/search?q=%22configuration.nix%22

https://www.google.com/search?q=%22config.nix%22

I got bored of wading through irrelevant search results, so I uninstalled Nix. (My experience with Guix was even worse, but in a different way.) When I want software that isn't in Debian's repos, I'll stick to installing it from source like I've been doing forever.

Outside of configuring your system, almost everything from NixOS is applicable to other distro's. The only notable exception I can think of are video drivers, and you will need nixGL for that.

Otherwise, I would recommend looking at home-manager, it's essentially NixOS but for any linux distro, or even darwin with nix-darwin. https://github.com/nix-community/home-manager