NixOS

Official Site

NixOS is a unique Linux distribution whose management philosophy sets it completely apart from any other distro or package manager. From my perspective, NixOS is essentially Gentoo governed by holy declarative laws, allowing users to build their own "Tower of Babel" on Linux using the reproducible and reliable power of Nix.

Nix

Nix is the package manager of NixOS, as well as the declarative, functional programming language designed to build it. Looked at as a programming language, Nix is close to "Haskell on JSON." When you are defining your system, it feels like JSON because most of your work consists of filling out attributes. When you are packaging software or projects, however, it works like Haskell because you can only write pure functions with no side effects. That is why it is called a "declarative functional programming language."

Nix is the foundation of what makes NixOS special, and it acts as the ultimate silver bullet for Dependency Hell on Linux. On normal Linux distributions, when two applications rely on different versions of the same dependency, a conflict occurs because Linux standard system paths do not naturally allow multiple versions of the same software to coexist. In most cases, users resort to Flatpak or AppImage, which follow the Windows approach: wrapping all the software's required environments into a single package. Nix solves this problem much more elegantly. It assigns each version of every dependency a specific hash value and isolates them in the filesystem based on that hash. Software can then accurately call the exact version of the dependency it needs through its hash value, without the need for brute-force file copying.

Flake

Flake is the most important submodule of Nix. Without Flake, NixOS is not 100% reproducible; even if you have the exact same configuration file, package versions on the standard nix-channel can change over time. Flake was designed to solve this exact problem. In the Nix ecosystem, a Flake acts as a pure function that takes package channels as inputs and outputs a NixOS configuration alongside a flake.lock file. The flake.lock file records the specific version of every package in your system, ensuring that every time you rebuild the system using the same flake.nix, you get the exact same system setup.

Flake also provides users with some extra benefits:

Home Manager

Home Manager goes even further than Flake. In a standard Nix setup with Flake, all packages are installed at the system level and shared by all users on the device. If you want to set up user-specific configurations, Home Manager allows you to install packages directly into user profiles and generate application config files under the ~/.config folder. Admittedly, it digs a bit too deep into the system and does not strictly follow the UNIX philosophy, which sometimes causes friction with certain applications. However, in most cases, I still love using it because it provides even better reproducibility than Flake alone.

Conclusion

Before trying NixOS, I used many different Linux distributions. They may differ in kernel-space setup, pre-installed packages, and release cycles, but their user-space processes for installing packages and updating the system are universally similar—and chaotic. Users often install packages for temporary use and forget to clean them up, or they make complicated system tweaks to solve a problem but forget exactly what they did when setting up a new device. NixOS provides a solution—one that is undeniably hard to understand at first, but ultimately helps users truly control their devices.

Advanced: NixOS for developers

2026-07-07 2253 NixOS for developers

My Setup

https://codeberg.org/HYJING/Nixos-Setup

Rate: 7/7 (7 Rating System)

License & Copyright

cc_badge.png
This article is licensed under the CC BY-NC-SA 4.0 license. Embedded code snippets are released under the GPLv3 license.
If you share or adapt this material, please provide a link back to this original page. See the Full License Policy for more details.