by totallywrong · 3y ago · 0 comments
If there's a single thing Nix solves, it's being able to declare packages with a pure/functional language.
This ends up enabling all sorts of useful things which relate to packages. e.g. being able to install multiple versions of some package without these overwriting each other. e.g. build container images, declare development environments, run software without installing it, etc.
I think you can get 80% of what Nix does in many use cases without paying a lot of the effort. -- e.g. `asdf` is a tool which allows for installing project-local dependencies of programs.
Regarding non-goals - I think that exposes the fundamental difference. rpm-ostree isn't "better". It's trying to solve different problems. The use case you described is a very small part of what Nix makes possible. Nix isn't just trying to fix or improve on existing systems - it present a fundamentally new abstraction that can be used for many purposes. Yes, you can configure and snapshot a list of packages, but that's a tiny part of it. With Nix, the capability allows you to also create any environment from scratch, isolated from other environments on your machine, e.g. for CI or development, or running some obscure python repo.
It's like the difference between SVN and git.
For example, most of my services that need to bind to some specific network interfaces but require an IP address, don't hardcode anything, they all in lines of `services.foo.listen = head config.networking.interfaces.vpn.ipv4.addresses`. Should I want to renumber my networking, it'll be relatively painless. Same with user IDs, passwords, paths, etc - they're all trying to be references rather than copies.
Of course, this can be done with an external template engine, but I like how Nix integrates all those aspects in a convenient package.