Hacker News new | ask | show | jobs
by thomastjeffery 2055 days ago
My favorite feature of NixOS is cleanliness.

I never need to worry about a mess anywhere outside of `/home`. Ever.

Ever make a symlink to fix a broken package and forget about it?

Ever make a change to a config file and forget about it?

Ever update your system and find out something is broken, just to spend time repairing the problem?

All these things tend to add up over months and years. After a while, I usually end up reinstalling my distro to start fresh.

Never again.

4 comments

I use NixOS for the same reason. Cleanliness is empowering.

I used to have diskless machines on my network set up the non-nix way: system directories full of tftp and pxe stuff; root directories constructed by an OS's installation procedure, and then customized somehow to work with an nfsroot. Later on, I wanted to make some changes but had no idea how. I hadn't taken enough notes of where everything came from and what it was doing. The files were still working, but without having documented their intent, I had to scrap it all. But documenting intent is laborious and fragile; you have to include enough detail that future you (or someone else) can follow your logic, and worse: keep all that in sync with the reality.

Since then I have fully committed to the Nix way. Now, the contents of my tftproot are built according to a declaration in my configuration.nix: the root directory in my TFTP configuration specifies a dependency on a PXE package, with some configuration applied. Not only don't I have to look through the built directories and try to remember what everything is, I never think about the built directories. The insight of declarative configuration is: if you fully document your intent, the system can take care of realizing it.

When I want to change a program I have written, I edit the source code (where all the intent is) and recompile it. NixOS is that for systems. I will no sooner go back to mutation-based system management than start changing my programs by taking a hex editor to the binary.

I've been using NixOS with home-manager and it's been a really nice experience because of this. Now I can keep my desktop and laptop pretty much in sync by just tracking 2 small git repos instead of having a log/script of all the config tweaks on /etc that I needed to do on random files.

And it gets better over time, more projects are supporting Nix, and there's exciting things being worked on, like IPFS support for the store, and Flakes to get proper reproducibility.

And even when you do screw things up, like accidentally deleting things in the Nix store, it's quite easy to recover as well.[0]

[0] https://nixos.org/manual/nix/stable/#sec-nix-store

On the other hand, getting some apps to work can be a bit of a pain with NixOS. Especially binaries and/or Steam games, things running through Wine can be a pain because standard libraries are in non-standard locations.

What I ended up doing since about a year or so is just make my whole root partition something I can generate with Debian debootstrap + chroot. I have a +- 250 LOC bash script which I just invoke on a free partition, and it just completely reinstalls Debian in there as if it were a Docker container.

I then rerun this about once every month, reboot, switch to the new partition (and fall back to the old one in case things went wrong, which almost never happens) and I couldn’t be happier with it. Happy middle ground.

> Especially binaries and/or Steam games, things running through Wine can be a pain because standard libraries are in non-standard locations.

Steam just works, though? I've been running nixpkgs.steam for a while, and it has consistently been the best Steam-on-Linux experience I've had. Precisely because what Steam sees is tightly controlled, and there's no place for accidental DLL/.so hell, and ambient changes to your OS making it into Steam/games breaking its assumptions.

(and for everything else you have steam-run/buildFHSUserEnv)

Steam itself works pretty well, but I've had many games just inexplicably segfault on startup. It's weird because I get the same segfault: - using steam-run - in a FHS user environment - in an LXD container (on this NixOS host) running Debian 10

The same games run fine on a Debian 10 host, all of the libraries the link to are bit-identical to the ones in the LXD container, and I've even tried running the exact same kernel.

I'm lost here, as I feel like I've made everything match (at least in the LXD container): the kernel is bit-identical, the games are bit-identical, the libraries they link to are bit-identical. There must be something I'm missing.

Try strace and look at what the is loaded by ld.so?
Yeah I’m not sure, I recall something with either Steam or the Blizzard Battlenet. I don’t know exactly what it was, but I do know that I spent a day or two trying to relocate objects in a binary application and I ended up just giving up.

Having said this, ostensibly I really like NixOS and I have actually used it as my main desktop for about a year back in 2015.

Have you taken a look at buildFHSUserEnv[1]? In the Mozilla Nixpkgs overlay it is used to package[2] the Vidyo desktop application.

[1] https://nixos.org/manual/nixpkgs/stable/#sec-fhs-environment... [2] https://github.com/mozilla/nixpkgs-mozilla/blob/master/pkgs/...

Fha user environments are great. I just wish they would support supplementary groups. Running programs that want device access is a no-go currently
Sounds like you'd like an OSTree-based Debian.
What’s that, if I may ask?
Take a look at Fedora Silverblue. It uses ostree.