Hacker News new | ask | show | jobs
by setheron 1985 days ago
The big idea in Nix is the view that the filesystem is like mutable memory in a programming language.

You wouldn't give access to memory raw without any safeguards. (Typical package managers can just arbitrarily dump files or remove files)

It takes a structured approach. Laying over a graph database on top of your filesystem which is read-only typically.

This helps provide guarantees and also every application has its own hermetic sealed dependency closure.

Nix is truly revolutionary and it's getting steady adoption. Give it a read if you don't know about it. You can adopt it on any Linux distro without using the full NixOS.

I write a lot about it on my blog.

2 comments

I love the guarantees given by Nix (I'm an immutable/functional-lang dev, Elixir specifically, so I really do get that), and I get that introducing a certain amount of complexity is sort of unavoidable when going in this direction (similarly, functional languages have a learning curve), but Nix for some reason still isn't clicking for me- I don't know if its UI is just terrible, its learning curve too steep, or something... but it's the sort of thing you can't just dabble in, you have to commit 200% to... and I think that's asking a lot of people. To use the cost/benefit analogy of functional languages, it feels like Nix has a much steeper cost to get the (admittedly unique) benefit of a completely deterministic software stack.
I find android way much simpler. On android every app has its own data and app directories, and you can uninstall, clear data or clear cache of apps safely. I know this method doesn't work out of the box with traditional desktop software that assumes a Unix like filesystem hierarchy. But Nix doesn't work out-of-the-box as well. I would be interested to know what other advantages Nix / GUIX bring in practical terms.
Nix is far more than just an app with its own directory (Which is also the flatpack & snap approach):

A little not exhaustive list of features that Nix provides:

- Not only an 'app installer'. It is a fully feature functional build system where reproducible builds are guaranteed (This is unique with GUIX up to my knowledge) on any linux distribution. Safe-reliable distributed builds are also possible.

- Fine grain de-duplication of dependencies (libraries, frameworks) to save disk space

- Safe, unprivileged installation of binaries in a multi-user environment on a single machine.

- Atomic upgrade and rollback

- Allow multiple variations of the same package with different options & versions installed in parallel without any risk of conflict

- Solves definitively all ABI breaks problem you encounter on traditional package manager, even with shared library.