#NixOS of Beginner
What is Declarative Configuration in NixOS? Understanding Declarative vs Imperative Approaches?
Comparing Declarative and Imperative distro in Linux.
NixOS is an open-source Linux distribution based on the Nix package manager. NixOS uses a declarative configuration system (approach) that allows reproducibility and portability.
In NixOS, you follow tutorials on YouTube and read blogs; you know nixos uses a declarative configuration system to configure NixOS, such as installing and managing packages and services.
To install the Package, add and remove the services you need to mention in your nixos configuration.nix
file and rebuild your nixos.
In the Linux distro world, there are two types of distro:
The Imperative type is the most common distro in linux ecosystem.
Declarative Approach
In the declarative approach, we use a file (such as a YAML, JSON, and Nix) to describe the configuration for hardware and software components such as systems, networking, users, services (like with systems), and more.