3 ms·
I've configured my own and work systems for a few years using Puppet and Ansible, and I have to say Nix is miles ahead of them both. - Actually reproducible bu
by l0b0 5y ago
I've configured my own and work systems for a few years using Puppet and Ansible, and I have to say Nix is miles ahead of them both.
- Actually reproducible builds, as opposed to "only if all the external factors involved, like time and third party packages, are identical between builds". One thing this enables is building your system packages in your automated pipeline and just downloading the resulting cache.
- Much more compact than either. For an example, the last state of my own Puppet configuration was [1] - five directories with hundreds of files. The current state is 13 files total, only one of which contains the Nix code actually needed to set up dozens of packages and services for a full desktop OS. That file clocks in at 346 lines, and comes in at a fraction of the size and complexity of the less featureful Puppet.
- Nix shell[2], where you can build a set of packages for use within a single project without having to worry about it borking other projects (like adding things to $PATH).
- Very few shell commands are ever needed.
- Built-in features I haven't seen in either of the other systems: allowing unfree packages either globally or individually, setting up UEFI, LUKS and LVM with a handful of lines, and stopping the compilation immediately if there's a problem rather than continuing by default.
The only caveat is the Nix language itself. The whole thing might be more complicated than the Puppet language, but you can see for yourself that the current configuration[3] isn't exactly rocket science.
[1] https://gitlab.com/victor-engmark/root/-/tree/daa391e1d957f72d950ec8f2538556a251679d72 https://gitlab.com/victor-engmark/root/-/tree/daa391e1d957f7...
[2] https://gitlab.com/victor-engmark/root/-/blob/master/shell.nix https://gitlab.com/victor-engmark/root/-/blob/master/shell.n...
[3] https://gitlab.com/victor-engmark/root/-/blob/7f52eccc8b4c4c27d10a52b82f16617e6df49f88/configuration.nix https://gitlab.com/victor-engmark/root/-/blob/7f52eccc8b4c4c...
- raffraffraff 5y agoCan you ever see it used by a large organisation to manage fleets of machines? Can you continually apply a NixOS codebase across thousands of machines, securely? Is the language capable of handling roles, environments etc? Does it support an external database where you can manage variables (bonus if the lookups are environment-aware, so a 'dev' machine in Europe doesn't get 'test' config from the US). If so then it could genuinely replace any existing CM system. But displacing the existing tech, rewriting the whole CM codebase and getting the team over the learning curve is a monumental. I get that Puppet isn't 100% reproducible, but my point (in another part of this thread) is that time marches on and there are only so many things you need to (or want to) 'pin'. In the past, our practice was to leave software versions all 'latest' except for known issues or requirements. Otherwise you're in a constant fight with the security folks over old software versions. If we hit an issue on a puppet run in our test environment, we put the brakes on the puppet rollout until it's. Once it gets through a few days in test, we promote it to the next environment, and eventually do a staged release through the production environments.