Every time I look at NixOS, I think that it perfectly solves a problem that I only have once every 5 years, when buying a new computer. I think I even looked into it once to automate that exact process, but that idea fell apart at the first line of Nix syntax. I'll stick with OSX and `brew bundle` I guess...
But then I read a piece like this and remember that some people do have to plumb the depths of C/C++ linkers, and I'm glad I'm not one of them.
Great post! FWIW I always want to know the prompt text when seeing an AI-generated image, I wish there were a convention around that.
I think it solves a problem that shouldn't exist: managing complex state in an operating system.
OSes should be mostly immutable. Apps should own their state. Everything else should be in a neat tidy box that is portable. Mobile almost gets this right.
The idea of installing things "on" the OS needs to die, badly. It's a security and privacy nightmare because it means everything more or less has root, and it makes every OS install a special snowflake that is under the hood a giant mixed pile of shit.
NixOS aside, Nix manages state _outside_ of / independent with respect to your operating system, which is why it's so damn useful.
With Nix, I can build OCI images the exact same way every time; with Docker, I have to hope that the `apt update` thrown in at the top doesn't accidentally put me on a new major version of some dependency that breaks the rest of the script. I tend to deal with Dockerfiles written five or more years ago, so I will admit to bias here.
I'll also admit that I don't really enjoy NixOS. It's neat enough on my headless devices but not something I'd want to try to daily drive; I'm more a fan of the Universal Blue / Project Bluefin approach.
For sure. Qubes OS is an interesting step in that direction. Mobile does mostly get it right - and yet the devices are single-user only, it's so odd. The fact that I can't share an iPad with my kid without needing to fully disable Messages, Photos, etc is crazy-making.
> ... because it means everything more or less has root, and it makes every OS install a special snowflake that is under the hood a giant mixed pile of shit.
In many Linux distros systemd as PID 1 comes to mind...
If anything systemd is a step against "a giant mixed pile of shit" in that the "shit" is single-source now as opposed to cobbled together from 10 different projects.
> Every time I look at NixOS, I think that it perfectly solves a problem that I only have once every 5 years, when buying a new computer. I think I even looked into it once to automate that exact process, but that idea fell apart at the first line of Nix syntax. I'll stick with OSX and `brew bundle` I guess...
To each their own!
With two Mac laptops, each with a Linux VM, plus five Raspberry Pi and a Mac Mini under Asahi on NixOS it's been a godsend to have a consistent management system and setup with reusable bricks, that is also able to remote build on the Mini for the Pis.
That plus shell.nix and direnv, and you can pry Nix from my cold, dead hands.
Chiming in to say that direnv is one of the greatest projects I've ever come across and it gets damn near everything right out of the box - you can also use it without any Nix at all. (It makes a nice gateway to Nix, though; once you have your directory-based env vars, it's a shorter hop to directory-based package configuration...)
† Depending on how you (re)start vscode (terminal vs launchd) it's going to either have some project env vars or not. e.g do `code /some/path` in a terminal and it inherits env vars from the terminal, which is nonsense on macOS because then if you reopen the project the env vars are gone because it's been relaunched by launchd. Dunno if it has been fixed but it was even worse when a vscode process initially started via terminal would have env vars inherited for all subsequently opened projects, even different ones.
Nix and direnv is such an insanely good combo. I use them together, typically via devenv, the latter sometimes as a library on top of a plain flake.nix, other times with the full devenv CLI and experiene— I love both for different use cases. Really pleasant.
But then I read a piece like this and remember that some people do have to plumb the depths of C/C++ linkers, and I'm glad I'm not one of them.
Great post! FWIW I always want to know the prompt text when seeing an AI-generated image, I wish there were a convention around that.