I'm starting to provide Chinese / English versions of some posts, switch with the Language menu above. 我开始提供部分文章的中文、英文翻译,请使用顶部语言菜单切换。
Illustration

NixOS Series 2: Basic Config, Nix Flake & Batch Deploy

List of NixOS Series Posts:NixOS Series 1: Why I fell in loveNixOS Series 2: Basic Config, Nix Flake & Batch DeployThis is the second post in my NixOS series, and mainly focuses on:Basic format of NixOS config files, and how to edit themFlake functionality of Nix package managerDeploy-RS deployment toolThis post assumes that you've installed NixOS with NixOS's official installation manual.Basic config ¶During NixOS's installation process, the nixos-generate-config tool should have generated an initial config file for you under /etc/nixos, with two files configuration.nix and hardware-configuration.nix. Ignore hardware-configuration.nix for the moment, as it's automatically generated based on your hardware and disk partition scheme. Let's open configuration.nix:...
Illustration

NixOS Series 1: Why I fell in love

List of NixOS Series Posts:NixOS Series 1: Why I fell in loveNixOS Series 2: Basic Config, Nix Flake & Batch DeployRight now I'm gradually migrating my servers from Devuan Linux to NixOS. NixOS is a Linux distribution centered on a set of Nix configuration files located in /etc/nixos, which is used to install and configure the whole operating system. Because this configuration set defines ALL config files and packages on the system, as long as you use the same config files, you will absolutely get the same operating system every time you reinstall. Nix configuration language is also Turing complete, so you will be able to generate config files with Nix, no matter how complicated that software is.Another important feature of Nix package manager is reproducible builds....