NixOS system configuration: Difference between revisions

DHCP (talk | contribs)
m Getting Instant System Flakes Repl: use lang=nix for `nix repl` snippet syntax highlighting. Although a "hack", i find it more readable. If i'm wrong, feel free to revert
Toastal (talk | contribs)
Remove the word “modern” for an experimental API as it suggests stable code is not modern
Line 59: Line 59:
== Defining NixOS as a flake ==
== Defining NixOS as a flake ==


[[Flakes]] offer an alternative, modern way to configure NixOS systems using a standardized and reproducible structure. With flakes, the system configuration — along with any additional inputs such as Nixpkgs or external modules — is managed declaratively within a <code>flake.nix</code> file.
[[Flakes]] offer an alternative way to configure NixOS systems using a standardized and reproducible structure. With flakes, the system configuration — along with any additional inputs such as Nixpkgs or external modules — is managed declaratively within a <code>flake.nix</code> file.


Unlike the traditional configuration model, which relies on <code>/etc/nixos/configuration.nix</code> and channels, flakes explicitly define their dependencies and configurations, making it easier to share, version, and reproduce complete NixOS system setups.
Unlike the traditional configuration model, which relies on <code>/etc/nixos/configuration.nix</code> and channels, flakes explicitly define their dependencies and configurations, making it easier to share, version, and reproduce complete NixOS system setups.