NixOS and Gentoo: systems to build yourself
In short: NixOS describes the whole system in a configuration file. Gentoo builds all programs from source code on your own computer. Both are for advanced users.
In more detail: What they share: maximum control through configuration.
In detail
- NixOS: declarative.
configuration.nixstates which packages, services and users exist.nixos-rebuild switchrebuilds the system. Every generation stays as a boot entry (rollback possible). Packages in/nix/storeseparated by hash, so no dependency conflicts. Flakes for reproducibility. - Nix outside NixOS: also usable as a package manager on other Linux systems and macOS,
nix-shellandnix developcreate development environments. - Gentoo: Portage package system with
emerge, USE flags decide which features are compiled into a program. Long compile times but tailor-made. Alternative: binary packages. - Learning value: Gentoo teaches how a Linux system is put together, NixOS how systems can be described reproducibly.
- Disadvantage: steep learning curve, lots of documentation to read.
See also: Immutable Linux systems (immutable distros), Building software from source (make, CMake)