At work, we’re currently designing our next production and deployment environement. As such we are in the process of evaluating Nix/NixOS as a solution.
Currently, we’re working with GitLab CI, Docker Images and Kubernetes. The developers are working on their workstations with simply a Docker daemon and whatever good IDE.
We want to move away from this workflow for the following reasons:
- As we add more and more language to the stack we have to handle every different package managers; sometimes we must use Ubuntu images as base for our Docker images, sometimes we can use Alpine ones, and in the end we have a far too diverse production environement which had led us in some strange situations in the past…
- We cannot use the exact same environement between development and production.
- Kubernetes is adding a lot of complexity in the stack, with an overhead that keeps increasing (Role-Based Acess Control, Service Discovery, Namespaces etc…).
- Now we just have too many configuration files (Dockerfile/Kubernetes YAML) in too many places, which makes tracking the current state of the environement really hard.
Nix/NixOS seems to address each of these issues by:
- Unifying the package management through Nix.
- Making the production environement a 1:1 reproduction of the developement one.
- Keeping the stack at a sane level of management for a small team.
- Keeping configuration files at consistent places, and always being able to predict the current state of our production.
The first part of my question is: is our understanding of what could Nix/NixOS bring us in production correct?
The second part of my question is more practical.
Let’s say we have switched our project to be built with Nix, and so we’re developping with it. What would be a sane practice for automated deployment?
From our understanding, if we have running nodes of NixOS instances we can use NixOps to manage those instances. Is it a good idea to execute NixOps from within a CI Task once the build is made to update all nodes automatically?
Thank you very much for any help