Table of contents For one of my network storage PC builds, I was looking for an alternative to Flatcar Container Linux and tried out NixOS again (after an almost 10 year break). There are many ways to install NixOS, and in this article I will outline how I like to install NixOS on physical hardware or virtual machines: over the network and fully declaratively. Introduction: Declarative? The term declarative means that you describe what should be accomplished, not how. For NixOS, that means you declare what software you want your system to include (add to config option environment.systemPackages, or enable a module) instead of, say, running apt install. A nice property of the declarative approach is that your system follows your configuration, so by reverting a configuration change, you can cleanly revert the change to the system as well. I like to manage declarative configuration files under version control, typically with Git. When I originally set up my current network storage build, I chose CoreOS (later Flatcar Container Linux) because it was an auto-updating base system with a declarative cloud-init config. Ways of installing NixOS Graphical Installer: Only for Desktops The NixOS manual’s “Installation” section describes a graphical installer (“for desktop users”, based on the Calamares system installer and added in 2022) and a manual installer. With the graphical installer, it’s easy to install NixOS to disk: just confirm the defaults often enough and you’ll end up with a working system. But there are some downsides: You need to manually enable SSH after the installation — locally, not via the network. The graphical installer generates an initial NixOS configuration for you, but there is no way to inject your own initial NixOS configuration. The graphical installer is clearly not meant for remote installation or automated installation. Manual Installation The manual installer on the other hand is too manual for my taste: expand “Example 2” and “Example 3” in t...
First seen: 2025-06-01 08:30
Last seen: 2025-06-02 06:35