Initial installation
A DNF network is set up step by step, and you can stop at any stage: a single workstation is enough to get started.
The journey
Section titled “The journey”- A workstation: the administrator’s machine (this page).
- A gateway: create a zone and connect other workstations to it.
- Coordination: link the zones together with a VPN (tailnet).
Assisted installation
Section titled “Assisted installation”The first workstation installs itself, from the generic ISO, with no other machine: this is the simplest path.
-
Get the image
The generic ISO attached to each framework release 🡕 (
dnf-installer-vX.Y.Z-x86_64-linux.iso), written to a USB stick. -
Boot the machine from the stick, wired, Secure Boot disabled.
-
Answer the wizard
It launches on its own on the console, once the network is up.
Ctrl-Cgives the command prompt, from where it restarts:Fenêtre de terminal darkone newIt asks for the language and keyboard, the administrator’s identity and password, the network domain, the machine name, the disk if there are several (not below 20 GB: the backup key is never offered), then disk encryption and its passphrase. The rest is detected: laptop or desktop, UEFI or BIOS, the country’s time zone. Unencrypted disk: a passphrase for the key backup.
-
Confirm
The summary shows the final choices (domain, login). The disk is then erased and the system installed, project included, in
/etc/nixos. -
Back up the keys, on a second USB stick
Plug in a USB stick (FAT, exFAT, ext4…), select it: nothing on it is erased. The wizard writes
dnf-backup-<domain>.tar.ageto it, then asks you to unplug and replug it to read it back. No reread backup, no end of installation. -
Reboot, USB sticks removed. Encrypted disk: the passphrase is requested at every boot, with the chosen keyboard. The first session opens a home page in the browser: step 1 of 4 done, the gateway next.
Scripted installation
Section titled “Scripted installation”An answers file stands in for the questions; a missing answer is requested, or refused with --non-interactive.
version: 1admin: login: "alice" name: "Alice Martin" passwordHash: '$y$j9T$...' # mkpasswd -m yescryptnetwork: domain: "example.org"host: hostname: "poste"disk: encrypt: truelocale: language: "fr_FR.UTF-8"backup: device: "/dev/disk/by-label/SECOURS" # clé USB de la sauvegardedarkone new --answers reponses.yaml --non-interactive --yes \ --luks-passphrase-file /run/user/1000/luksThe disk passphrase never goes into the answers file, which circulates: --luks-passphrase-file reads it from a file, otherwise it is requested. It also encrypts the backup; unencrypted disk, that is --backup-passphrase-file. In scripted mode, the USB stick is reread without being unplugged.
Key backup
Section titled “Key backup”dnf-backup-<domain>.tar.age, encrypted with age, contains:
nix/: the (SSH) deployment key and the admin age key derived from it;infra.key: the infra age key;project.bundle: the project,/etc/nixos, as agit bundle.
To open it, on any Linux with age:
age -d dnf-backup-example.org.tar.age | tar -xgit clone dnf-backup/project.bundle mon-reseauOn a new administration workstation, the keys go back in place, under the nix account, in mode 600: /home/nix/.ssh/id_ed25519, /home/nix/.config/sops/age/keys.txt and /etc/sops/age/infra.key. As the project evolves: just backup-admin <device> redoes the backup (recipes).
--dry-run prints the plan without touching anything, on any machine.
Creating the project
Section titled “Creating the project”Manual path, from an administration machine that is already a DNF host.
The project starts from the template provided by the framework: a ready-made structure and a commented etc/config.yaml to fill in.
-
Create the repository
Fenêtre de terminal nix flake new -t github:darkone-linux/darkone-nixos-framework mon-reseaucd mon-reseau && git init && git add -AThe project pins the latest framework release. Another path: the GitHub template dnf-boilerplate 🡕 (the “Use this template” button), a published copy of the same template.
-
Bootstrap the framework
Fenêtre de terminal nix run github:darkone-linux/darkone-nixos-framework#initnix develop github:darkone-linux/darkone-nixos-framework -
Initialize the secrets
Fenêtre de terminal just configure-admin-host
Describing the configuration
Section titled “Describing the configuration”Everything is declared in etc/config.yaml (network, zones, users, hosts).
For a first workstation, one zone, one user and one host suffice: every host belongs to a zone (or carries a public ipv4 address).
An editor with yaml-language-server (Zed, VS Code with the YAML extension…) completes and validates every key, thanks to this first line of the file (already present in a project created from the template):
# yaml-language-server: $schema=../dnf/config/config.schema.jsonzones: main: description: "Réseau principal" ipPrefix: "10.0" # cette zone utilise 10.0.0.0/16
users: alice: uid: 1000 name: "Alice" profile: "nix-admin" groups: ["global"]
hosts: - hostname: "poste" name: "Poste de l'administrateur" zone: "main:1.10" # IP fixe 10.0.1.10 ("main" seul = DHCP) profile: "desktop" users: ["alice"] disko: profile: "btrfs-1-disk" devices: main: "/dev/nvme0n1"Then regenerate, check and commit:
just generate # produit var/generated/*.nix depuis etc/config.yamljust check-flake # nix flake checkgit add . && git commit -m "Premier hôte"Installing a workstation
Section titled “Installing a workstation”The installation writes an image, boots the machine from it, then applies the full system.
-
Get the image
Fenêtre de terminal just build-isoThis image carries your deployment key. Another path, without building: the generic ISO attached to each framework release 🡕 (
dnf-installer-vX.Y.Z-x86_64-linux.iso); the key then authorizes itself at boot. -
Boot the machine
Write the image to a USB stick, plug the computer into the network wired, then boot from the stick. Before the command prompt, the screen shows a DNF welcome message, then the IP address and MAC address of the interface connected to the Internet (served by the local gateway or your router): note them down.
- IP: 10.0.0.50- MAC: aa:bb:cc:dd:ee:ffThe
dnf-netinfocommand displays them again.With the generic ISO, the screen reminds you: set a password (
passwd), then authorize the key from the admin workstation.Fenêtre de terminal sudo -i -u nix ssh-copy-id nixos@10.0.0.50 -
Set the addresses (as soon as a zone exists)
The installation ends with a reboot, and the next steps must find the machine again. Two cases:
- MAC address already declared: nothing to do, the gateway serves the same static address to the USB stick and the installed system;
- MAC address unknown: read it, then declare it.
Fenêtre de terminal # just host-info <hôte> <ip-actuelle>just host-info poste 10.0.0.50Enter the value in
etc/config.yaml, with a static address, then redeploy the gateway of each affected zone:etc/config.yaml - hostname: "poste"zone: "maison:2.1"mac: "aa:bb:cc:dd:ee:ff"Fenêtre de terminal # Redéployer la passerelle localejust cleangit add . && git commit -m "host(poste): installation"just apply gw -
Install the system
Fenêtre de terminal # just full-install <hôte> <utilisateur> <ip>just full-install poste nixos 10.0.0.50 -
The system is installed and up to date.