3 ms·
The problem Nix wants to solve is a valid one. But there are better alternatives imo, such as the newer distros based on rpm-ostree. You can do atomic upgrades,
by totallywrong 3y ago
The problem Nix wants to solve is a valid one. But there are better alternatives imo, such as the newer distros based on rpm-ostree. You can do atomic upgrades, and easily rollback to a previous known good state if needed. No changes are allowed to a live system. And best of all, it's practically the same in terms of management, there's hardly any learning curve.
- colordrops 3y agoSounds interesting. Is rpm-ostree config declarative? Can it install multiple versions of packages and libs simultaneously? Are adding custom packages to your setup a matter of a few lines of additional config, or must you learn RPM? Can you manage home directory config as well?
- totallywrong 3y agoThere's the treefile [1] for declarative config, no need to learn RPM, just add package names and any extra config. As for managing home and multiple versions simultaneously, I think those are non-goals for this tool. [1] https://coreos.github.io/rpm-ostree/treefile https://coreos.github.io/rpm-ostree/treefile
- colordrops 3y agoI meant creating an entirely new package from scratch. 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.
- totallywrong 3y agoYes you're right, better wasn't a good choice of words. My comment was in the context of replacing Ansible with Nix for making a reproducible system, as per the linked article. I wanted to point out that alternative which will be much more familiar to most people, who perhaps aren't ready to jump to an entirely new paradigm, but still want a declarative config. But undoubtedly Nix is much more powerful. I myself have been meaning to try out Nix on top of my rpm-ostree system, for dev environments.
- colordrops 3y agoMakes sense, I'm sure that there are many on RPM-based systems that would enjoy a quick win like rpm-ostree.
- drdaeman 3y agoHow about configuration management? Getting the packages is half the story.
- totallywrong 3y agoThe treefile allows you to define arbitrary config files to inject into the image.
- drdaeman 3y agoWell, it sounds to be somewhat more limited than how Nix manages services. The beauty of Nix is the ability to stay DRY and declare things only once, then refer to them where you need it. 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.
- rgoulter 3y agoI think nix falls under "second best at everything" in this regard. 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.