Illustration for NixOS Series 5: Creating Disk Image for Low RAM VPS

NixOS Series 5: Creating Disk Image for Low RAM VPS

List of NixOS Series Posts: NixOS Series 1: Why I fell in love NixOS Series 2: Basic Config, Nix Flake & Batch Deploy Recommended: NixOS & Nix Flakes - A Guide for Beginners by Ryan Yin NixOS Series 3: Software Packaging 101 NixOS Series 4: "Stateless" Operating System NixOS Series 5: Creating Disk Image for Low RAM VPS Black friday has passed. Some readers, I believe, have perchased some VPSes or cloud servers on sale, and want to install NixOS on them. However, since NixOS is nowhere as famous as popular Linux distros, such as CentOS, Debian and Ubuntu, almost no VPS provider will offer a disk image preinstalled with NixOS. This lefts the user one of the following options to perform the installation manually: Mounting NixOS's installer ISO,...

Illustration for NixOS Series 4: "Stateless" Operating System

NixOS Series 4: "Stateless" Operating System

List of NixOS Series Posts: NixOS Series 1: Why I fell in love NixOS Series 2: Basic Config, Nix Flake & Batch Deploy Recommended: NixOS & Nix Flakes - A Guide for Beginners by Ryan Yin NixOS Series 3: Software Packaging 101 NixOS Series 4: "Stateless" Operating System NixOS Series 5: Creating Disk Image for Low RAM VPS Changelog: 2023-02-18: Fix config not applied to the root user, in the "Move Temp Directory of Nix Daemon" section. One of the most famous features of NixOS is that most software configurations on the system are generated and managed exclusively by a Nix-language config file. Even if such software modifies its config file while running, the config file will still be overwritten on the next Nix config switch or the next reboot. For example,...

Illustration for NixOS Series 3: Software Packaging 101

NixOS Series 3: Software Packaging 101

List of NixOS Series Posts: NixOS Series 1: Why I fell in love NixOS Series 2: Basic Config, Nix Flake & Batch Deploy Recommended: NixOS & Nix Flakes - A Guide for Beginners by Ryan Yin NixOS Series 3: Software Packaging 101 NixOS Series 4: "Stateless" Operating System NixOS Series 5: Creating Disk Image for Low RAM VPS One characteristic of NixOS is that all binary applications and libraries are stored in /nix/store directory and managed by Nix package manager. This means that NixOS doesn't conform to the FHS standard of Linux , and there's not even a dynamic library loader like ld-linux-x86-64.so.2 in /lib or /lib64 , let alone other shared libraries like libc.so . Therefore, unless the program is statically linked,...

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

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

List of NixOS Series Posts: NixOS Series 1: Why I fell in love NixOS Series 2: Basic Config, Nix Flake & Batch Deploy Recommended: NixOS & Nix Flakes - A Guide for Beginners by Ryan Yin NixOS Series 3: Software Packaging 101 NixOS Series 4: "Stateless" Operating System NixOS Series 5: Creating Disk Image for Low RAM VPS This is the second post in my NixOS series and mainly focuses on: Basic format of NixOS config files and how to edit them Flake functionality of Nix package manager Deploy-RS deployment tool This post assumes that you've installed NixOS with NixOS's official installation manual . Changelog 2023-05-10: Add a recommended post: NixOS & Nix Flakes - A Guide for Beginners by Ryan Yin. 2021-12-18: NixOS 21....

Illustration for NixOS Series 1: Why I fell in love

NixOS Series 1: Why I fell in love

List of NixOS Series Posts: NixOS Series 1: Why I fell in love NixOS Series 2: Basic Config, Nix Flake & Batch Deploy Recommended: NixOS & Nix Flakes - A Guide for Beginners by Ryan Yin NixOS Series 3: Software Packaging 101 NixOS Series 4: "Stateless" Operating System NixOS Series 5: Creating Disk Image for Low RAM VPS Right 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....