Overview of the NixOS Linux distribution: Difference between revisions

imported>Makefu
No edit summary
imported>Makefu
fix markup
Line 162: Line 162:
=== Comparsion to traditional Linux Distributions ===
=== Comparsion to traditional Linux Distributions ===


The main difference between to Linux Distribution is that NixOS does not follow the [https://en.wikipedia.org/wiki/Linux_Standard_Base Linux Standard Base] file system structure. On LSB-compliant systems software is stored under /{,usr}/{bin,lib,share} and configuration is generally stored in /etc .
The main difference between to Linux Distribution is that NixOS does not follow the [https://en.wikipedia.org/wiki/Linux_Standard_Base Linux Standard Base] file system structure. On LSB-compliant systems software is stored under ''/{,usr}/{bin,lib,share}'' and configuration is generally stored in ''/etc'' .


Software binaries become available for the user environment if they are placed in the bin folder of the LSB. When software is compiled with dynamic library links it will look up the required libraries in the LSB folders ( <code>usr/lib</code> ) and load it.
Software binaries become available for the user environment if they are placed in the bin folder of the LSB. When software is compiled with dynamic library links it will look up the required libraries in the LSB folders ( ''/usr/lib'' ) and load it.


In NixOS however this structure is not in place. Instead, user environments are essentially a number of symbolic links to all required packages and auxiliary files. These environments are stored in <code>nix/var/nix/profiles</code> . Each user maintains its own environment.
In NixOS however this structure is not in place. Instead, user environments are essentially a number of symbolic links to all required packages and auxiliary files. These environments are stored in ''nix/var/nix/profiles'' . Each user maintains its own environment.
The booted system profile is stored in a similar fashion but also contains the kernel, firmware, configuration and startup files.
The booted system profile is stored in a similar fashion but also contains the kernel, firmware, configuration and startup files.


Line 176: Line 176:


=== Usage of the Nix Store ===
=== Usage of the Nix Store ===
A lot of confusion for newcomers arises from the fact that configuration is stored in the read-only nix store along with all the installed packages. This fact makes it impossible to manually edit system configuration, all configuration changes must be performed by editing the **/etc/nixos/configuration.nix** file. NixOS provides the Modules System for editing all required configurations. Users should first check if an option for the configuration they require already exist before manually adding files or configuration via low-level NixOS features like activation scripts.
A lot of confusion for newcomers arises from the fact that configuration is stored in the read-only nix store along with all the installed packages. This fact makes it impossible to manually edit system configuration, all configuration changes must be performed by editing the ''/etc/nixos/configuration.nix'' file. NixOS provides the Modules System for editing all required configurations. Users should first check if an option for the configuration they require already exist before manually adding files or configuration via low-level NixOS features like activation scripts.


The system purity makes it possible to share system configuration without the need to edit multiple files. If you provide the same inputs, same version of **nixpkgs** and **configuration.nix** you will get the exact same booted system once deployed.
The system purity makes it possible to share system configuration without the need to edit multiple files. If you provide the same inputs, same version of '''nixpkgs''' and '''configuration.nix''' you will get the exact same booted system once deployed.


=== Modules ===
=== Modules ===