Live data from Hacker News

Why I love NixOS

birkey.co

141–150 of 323 posts

Re: Why I love NixOS

#141

I tried NixOS a few months ago, when I had to choose a new OS for my laptop. On the one hand, it's great, as so many others here and TFA have attested. Declaratively specifying your system configuration and using snapshots to keep track of everything is a complete game-changer. Similarly great is the absolutely huge universe of installable packages. The coverage here is so much better than what's on offer from Ubuntu…

I can completely understand how you were driven away. If you ever want to give it a go again:

> there's "Flakes" which I never quite understood

Nix never clicked for me until I started using flakes. There's a lot of internal drama surrounding them that honestly childish; that's why they are marked as experimental and not the official recommendation. You are going to have a worse time with Nix if you go with the official recommendation, flakes are significantly more intuitive. The Determinate Systems installer enables them by default, and whatever documentation they have is on the happier path (except for FlakeHub, I haven't figured that one out yet).

On the most fundamental level, flakes allow you to take /etc/nixos/nixos.nix (or whatever, it has been forever) out of /etc and into a git repository. Old-style nix may be able to do that, but I discovered flakes before trying. I did previously attempt to use git on /etc/nix, but git was falling to pieces with bizarre ownership problems.

What this means is that I could install and completely configure a machine, once booted into a nix iso, by running: nixos-install --flake https://github.com/.../repo.git. I manage all of my system config out of /home/$user/$clone

As for /home there is home-manager and, again, you are not steered towards it (the tutorial pushes you towards nix profiles/nix-env instead). Home-manager will do for your home directory what the system config does for your system, and has many program modules. You can even declare home-level systemd units and whatnot.

> manually edited /etc files.

You can use environment.etc for these files[1]. systemd.tmpfiles can be used for things outside of etc. Home-manager has the equivalent for .config, .local, .cache. [2].

[1]: https://search.nixos.org/options?channel=unstable&query=envi... [2]: https://home-manager-options.extranix.com/?query=xdg.configF...

Re: Why I love NixOS

#142
post #5

I don’t any experience with Nix - but how does it handle software which runs its own updating processes outside the package manager? Specifically thinking about software like Discord, Slack, Docker Desktop, Jetbrains Toolbox, etc. Is the Nix-ism to just reject using such software?

No there’s a nerd who will obsessively submit the latest version of any popular software that does that to nixpkgs. Or suggest you use the flatpak.

I generally use flatpak for things that are important to keep extremely updated, e.g. my browser for vulnerability reasons.

Re: Why I love NixOS

#143

The author almost touches on the one more topic that I adore about Nix, but ends up just so missing it: NixOS is absolutely incredible for its ability to be configured through AI tooling. And I don't mean that it's better than other operating systems, I mean that it's the only game in town. I've been using Nix, both the package manager and the operating system, for years by now. I agree with all of the author's point…

Wouldn’t any immutable OS accomplish this goal?

No. To gain that level of control you need a declarative distro.

Immutability and rollbacks are merely nice side effects of the Nix model.

Re: Why I love NixOS

#144
post #4

Although I’ve never committed to using nix system-wide, I do enjoy nix-based using https://devenv.sh/ for the very reasons described in the article. It’s much easier than local containers for development.

Can you help me understand why devenv is needed instead of a shell like this/what is gained? { pkgs }: pkgs.mkShell { nativeBuildInputs = with pkgs; [ # build tools cmake ninja gnumake pkg-config ]; buildInputs = with pkgs; [ # java jdk8 # compilers gcc clang llvmPackages.libcxx # libraries capstone icu openssl_3 libusb1 libftdi zlib # scripting (python3.withPackages (ps: with ps; [ requests pyelftools ])) ]; # capst…

devenv lets you express shells as modules.

Modules let you express the system in smaller, composable, reusable parts rather than express everything in one big file. (There are other popular tools which support modules: NixOS, home-manager, flake-parts).

That devenv also provides "batteries included" modules for popular languages (including linters, LSPs) is also a benefit.

Re: Why I love NixOS

#145

After having done the switch to nixOS, I can confidently say that managing a system any other way (like with apt/brew + 20 handwritten bash scripts) really is neanderthal technology and nix is superior in every single way. It's also great for the AI era, copilot is really good with that stuff.

> nix is superior in every single way.

My experience using NixOS on desktop is that it's 95% wonderful, 5% very painful.

If you run into friction with NixOS, you may need to have a wider/deeper understanding of what you're trying to do, compared to the more typical Linux OSs which can be beaten into shape.

With NixOS, you pay all the complexity up front.

Re: Why I love NixOS

#146

All the fun of Terraform with none of the profitability.

For a single machine? Yeah, NixOS' cost surely outweighs the benefits if you're not familiar with Nix.

Using Nix for per-project development dependencies is quite good. It's nice to be able to return to a project & not have to fuss over which tools/libraries need to be installed.

Re: Why I love NixOS

#147

The author almost touches on the one more topic that I adore about Nix, but ends up just so missing it: NixOS is absolutely incredible for its ability to be configured through AI tooling. And I don't mean that it's better than other operating systems, I mean that it's the only game in town. I've been using Nix, both the package manager and the operating system, for years by now. I agree with all of the author's point…

> it's the only game in town

Hey now, LLMs are pretty good at Guix, too.

Re: Why I love NixOS

#148

I tried NixOS a few months ago, when I had to choose a new OS for my laptop. On the one hand, it's great, as so many others here and TFA have attested. Declaratively specifying your system configuration and using snapshots to keep track of everything is a complete game-changer. Similarly great is the absolutely huge universe of installable packages. The coverage here is so much better than what's on offer from Ubuntu…

> Then there's "Flakes" which I never quite understood

Flakes do 2 things:

1. Declaration of the inputs and outputs of some Nix codebase. 2. Pinning the versions of this input sources.

The dependency pinning is similar to package.json/package.lock etc. which are common in language-specific package managers.

Re: Why I love NixOS

#149

The author almost touches on the one more topic that I adore about Nix, but ends up just so missing it: NixOS is absolutely incredible for its ability to be configured through AI tooling. And I don't mean that it's better than other operating systems, I mean that it's the only game in town. I've been using Nix, both the package manager and the operating system, for years by now. I agree with all of the author's point…

It's unreal. I've packaged so many super daunting packages that would take myself weeks to package (and some that I've tried and failed to package). I have 6 years of daily driving nixos...So I'm not exactly new to the distro.

Even messing with stdenv or language builders is trivialized. Any software that I want, I can get within a few hours of claude/codex just spinning unsupervised. It's so nice! Underrated for sure.

Re: Why I love NixOS

#150

I tried NixOS a few months ago, when I had to choose a new OS for my laptop. On the one hand, it's great, as so many others here and TFA have attested. Declaratively specifying your system configuration and using snapshots to keep track of everything is a complete game-changer. Similarly great is the absolutely huge universe of installable packages. The coverage here is so much better than what's on offer from Ubuntu…

I can completely understand how you were driven away. If you ever want to give it a go again: > there's "Flakes" which I never quite understood Nix never clicked for me until I started using flakes. There's a lot of internal drama surrounding them that honestly childish; that's why they are marked as experimental and not the official recommendation. You are going to have a worse time with Nix if you go with the offic…

Great comment -- thank you!
Post reply on HN