Introduction to NixOS
NixOS is a Linux distribution based on the Nix package manager, whose main focus is the declarative configuration and total reproducibility of the system. Instead of changing configuration files in a mandatory way, NixOS allows you to describe the entire desired state of the system in a single file, which facilitates replication, deployment and recovery of identical environments on different machines.
What is NixOS?
NixOS differs from other distributions because its entire operating system is built from functional expressions of the Nix language. Each package, service and configuration is treated as a pure dependence, which eliminates version conflicts and ensures that an installation is identical regardless of the history of previous changes. This is achieved by an immutable package store located in/nix/store, where each version of a package has its own unique path based on its cryptographic hash.
The Nix package manager
In the heart of NixOS is the Nix package manager, who operates with a functional model: the packages are built from expressions that specify their exact dependencies. When a package is installed or updated, Nix creates a new route in the warehouse, leaving the previous one intact. This allows you to performrollbacksinstant to any previous state simply by changing the symbolic link that points to the active version.
Advantages of NixOS
- Total reproducibility: the same configuration file generates identical systems on any hardware.
- Secure updates and rollbacks: thanks to the immutable warehouse, returning to an earlier version is as simple as changing a link.
- Isolation of dependencies: each package receives its own library versions, avoiding the call «hell of dependencies».
- Declarative configuration: manage services, users and file systems using readable and versionable code.
- Consistent development environments: time shells can be created with exact dependencies using
nix-shell.
Disadvantages and challenges
- Speech learning curve: functional paradigm and Nix language may be strange for users used to traditional distributions.
- Packing gap in some repositories: Although the ecosystem grows fast, certain proprietary or unusual software may require manual packaging.
- Disk space consumption: maintaining multiple versions of packages can take up more space than a traditional approach.
Typical cases of use
NixOS shines in scenarios where consistency and traceability are critical: production servers that must be replicated exactly, research environments that require reproducibility of experiments, CI / CD pipelines that deploy identical infrastructure in each execution, and developer workstations that need to isolate various project units without conflict.
How to start with NixOS
- Download the latest official ISO from the NixOS website and create a boot medium.
- Start the installer and partition the disk as needed (it is recommended to use
ext4orbtrfsfor the root). - Ride partitions and run
nixos-generate-configto create a base configuration file in/mnt/etc/nixos/configuration.nix. - Edit that file to define the hostname, user, services (such as SSH, Docker, etc.) and the desired desktop environment.
- Run
nixos-installto install the system based on the declarative configuration. - Restart, remove the installation medium and start using the system; any future change is done by editing
configuration.nixand runningnixos-rebuild switch.
Community and resources
The NixOS community is active and collaborative, with channels in Discourse, Matrix and IRC where modules, tricks and problem solutions are shared. Official documentation, available atnixpkgsIn GitHub it houses more than 80 000 packages, which is one of the largest available free software repositories.
Conclusion
NixOS represents a powerful alternative for those looking for an operating system where the configuration is treated as code, ensuring reproducibility, safety and ease of maintenance. Although its adoption requires a change of mind, long-term benefits — especially in professional and development environments — They make time investment worth it.


