13 lines
1.8 KiB
Org Mode
13 lines
1.8 KiB
Org Mode
:PROPERTIES:
|
|
:ID: 039e64b4-8979-4276-99a6-0b018cc4665b
|
|
:END:
|
|
#+title: nixos
|
|
|
|
NixOS is a Linux distribution built around the [[id:04b1edf2-9532-4060-8b2f-f37199cbfd92][nix]] package manager. Unlike traditional Linux distributions, NixOS uses a functional language to describe the system configuration. This enables complete system profiles to be generated, allowing for reproducible deployments, atomic upgrades, and system rollbacks.
|
|
|
|
All installations and configurations are done mainly in one file: configuration.nix. Every component, from packages to port openings and the [[id:0613de5a-4b4f-429a-ba52-09d63c0a92d6][window-manager]], is declared and configured here. This file can be split up using flakes and home-manager. The home folder for the configurations is ~~/nixhome~. The main flake, which defines the configuration layout, is located there. Inside the main folder are other subfolders containing more configuration files. The main configuration file *configuration.nix* is located in ~~/nixhome/hosts/server~ or ~~/nixhome/hosts/worker~, depending on the desired structure.
|
|
|
|
The hardware-configuration.nix file, which defines the hardware layout of your system, is in the same folder. This file is autogenerated and can be obtained using the =sudo nixos-generate-config= command in the ~/etc/nixos~ folder. The configuration.nix file should be the same for every [[id:f2b1d5af-1a7d-47a5-95c8-4a85d558419e][server]] in use. If a server requires special programs or configurations, these changes are made in the Nix modules. These modules are loaded into configuration.nix depending on the [[id:0dea8c51-5e1e-460c-9d0a-28293d62013e][VM]]. These modules are located in ~~/nixhome/modules/nixos~ and are named after the structure using them. For example: A VM needs Emacs to be installed. The VM is called VM1, so the module file is called VM1.nix.
|
|
|
|
|