4 ms·
Nix allows to have a "declarative" approach to configuration management, whereas Ansible uses a more "imperative" approach. For example, applying a Nix configu
by alduin32 5y ago
Nix allows to have a "declarative" approach to configuration management, whereas Ansible uses a more "imperative" approach.
For example, applying a Nix configuration is more-or-less guaranteed to be an idempotent operation, while this is not guaranteed at all using Ansible : many Ansible modules are not idempotent at all.
This brings many useful features, for example the ability to rollback to a previous state, or more generally the ability to have some determinism in configuration management of complex systems.
Nix and Docker can be combined together, I have many hosts where some services run in Docker containers, where the Dockerfile is defined in the Nix configuration itself, or generated by composing the upstream Dockerfile with my own configuration values.