Skip to content

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.

  1. A workstation : the administrator’s machine (this page).
  2. A gateway : create a zone and connect other machines to it (darkone add gateway).
  3. Servers and services : files, photos, messaging… see the service catalog.
  4. Internet : link the zones together with a VPN (tailnet).
ItemRequired
Machinex86_64, UEFI recommended
Secure Bootdisabled
Disk20 GB minimum
Memory6 GB (threshold: 5500 MiB)
USB drivestwo: installer and backup
NetworkInternet, ≈ 5 GB downloaded

Disk encryption requires UEFI. The memory check reads MemTotal : a 6 GB machine passes, a 4 GB one is rejected. The installer and the installation live in memory : with 4 GB, the machine saturates and the installation does not complete.

  1. Download

    The ISO and its checksum, attached to each framework release 🡕 : dnf-installer-vX.Y.Z-x86_64-linux.iso and its .sha256.

  2. Verify the checksum

    In the folder containing both files :

    Fenêtre de terminal
    sha256sum -c dnf-installer-vX.Y.Z-x86_64-linux.iso.sha256

    Expected : dnf-installer-vX.Y.Z-x86_64-linux.iso: OK.

  3. Burn the key

    Locate the key with lsblk, then write the image to it :

    Fenêtre de terminal
    sudo dd if=dnf-installer-vX.Y.Z-x86_64-linux.iso of=/dev/sdX bs=4M status=progress conv=fsync

The first workstation installs on its own, from the generic ISO, with no other machine : it is the simplest path. The darkone new assistant is displayed in English.

  1. Boot the machine from the key, preferably with a wired connection.

    Without a cable, the console waits for the network, and Enter opens nmtui to choose a Wi-Fi. Once the network is up, a menu offers three choices (type the number, then Enter) :

    ChoiceEffect
    1) New networkruns darkone new (this page)
    2) Add this machine to an existing networkdisplays a pairing code, see Gateway and Add a machine
    3) Shellcommand prompt
  2. Answer the assistant

    Choose 1. Before the first question, the assistant checks the memory, the network and the clock ; on failure, Check again, Connect to Wi-Fi or Abort. From the command prompt (Ctrl-C or choice 3), it starts again :

    Fenêtre de terminal
    darkone new

    It asks for the language and keyboard, the administrator’s identity and password, the network domain (home.arpa if you have no domain of your own), the machine name, the disk if there are several (no smaller than 20 GB : the backup key is never offered), disk encryption, then the disk passphrase. The rest is detected : laptop or desktop, UEFI or BIOS, country time zone. Unencrypted disk : one passphrase for backing up the keys.

    The disk passphrase becomes the fleet passphrase (luks-passphrase) : any encrypted host installed afterwards is formatted with it. See Disk encryption (LUKS).

  3. Confirm

    The summary points out the final choices (domain, login, zone). The disk is then wiped and the system installed, the project included in /etc/nixos.

  4. Back up the keys, to a second USB key

    Plug in a USB key (FAT, exFAT, ext4…), select it : nothing on it is erased. The assistant writes dnf-backup-<domain>.tar.age to it, then asks you to unplug and plug it back in to read it again. With no key available (a VM) : Skip for now, at your own risk, then just backup-admin <device> from the installed system.

  5. Reboot, with the USB keys removed.

    The assistant asks Remove the installation USB key. Reboot now? (no by default). Encrypted disk : the passphrase is requested at every boot, with the chosen keyboard. The first session opens a welcome page in the browser : step 1 of 4 completed, the gateway next (reopened later, it marks step 2 done as soon as the gateway is installed). It stays within reach in the Local network folder of the applications (First steps), along with the documentation (DNF Doc) and a terminal in the /etc/nixos project (Network sources), whose README.md summarizes everyday use.

  • nixos-install is restarted on its own, 3 attempts (attempt N/3) ; the store already copied is kept.
  • Beyond that, Retry? [y/N] at a terminal, otherwise the failure is reported.
  • Ctrl-C stops without a new attempt, and returns control.
  • Restart darkone new in the same ISO session : Previous install.
  • Resume : same answers, project and disk kept, nothing erased.
  • Start from scratch : project deleted, disk erased after the summary.
  • Abort : nothing changes.

The answers live in RAM ($XDG_RUNTIME_DIR/dnf-answers.yaml), the passphrases never : Resume asks for them again. If resuming is impossible, the wizard says why (It cannot be resumed) and offers only the rest. If the ISO is rebooted, the project is lost : start from scratch.

At boot, Enter opens nmtui ; from the command prompt, nmtui does the same. A check that fails also offers Connect to Wi-Fi. A captive portal blocks the installation : sign in there first.

On a Linux with Nix and KVM, a single command boots the ISO in a QEMU window, virtual disk included :

Fenêtre de terminal
nix run github:darkone-linux/darkone-nixos-framework#try

The disk is kept from one run to the next (~/.local/share/dnf-try) ; nix run …#try -- --reset starts from scratch. A VM has no USB key for the backup : Skip for now, then just backup-admin once installed.

An answers file takes the place of the questions ; a missing answer is requested, or refused with --non-interactive.

reponses.yaml
version: 1
admin:
login: "alice"
name: "Alice Martin"
passwordHash: '$y$j9T$...' # mkpasswd -m yescrypt
network:
domain: "example.org"
host:
hostname: "poste"
disk:
encrypt: true
locale:
language: "fr_FR.UTF-8"
backup:
device: "/dev/disk/by-label/SECOURS" # clé USB de la sauvegarde
Fenêtre de terminal
darkone new --answers reponses.yaml --non-interactive --yes \
--luks-passphrase-file /run/user/1000/luks

The disk passphrase never goes into the answers file, which gets passed around : --luks-passphrase-file reads it from a file, otherwise it is requested. It also encrypts the backup ; for an unencrypted disk, it is --backup-passphrase-file. In scripted mode, the USB key is read back without being unplugged.

  • --resume : resumes the interrupted installation of the session (with --non-interactive).
  • --dry-run : displays the plan without touching anything, on any machine.
  • Serial console : no menu, run darkone new manually.
  • Package cache, in addition to cache.nixos.org : --cache <url>, DNF_CACHE or cache.url.

dnf-backup-<domain>.tar.age, encrypted with age, on the key’s file system, with its dnf-backup-<domain>.README.txt in plain text :

  • nix/ : the deployment key (SSH) and the admin age key derived from it ;
  • infra.key : the infra age key ;
  • project.bundle : the project, /etc/nixos, as a git bundle.

To open it, on any Linux with age :

Fenêtre de terminal
age -d dnf-backup-example.org.tar.age | tar -x
git clone dnf-backup/project.bundle mon-reseau

On a new administration workstation, the keys take their place again, 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. The project evolves : just backup-admin <device> redoes the backup, keeping the old one renamed with its date (recipes).

As long as /var/lib/dnf/backup-admin is missing, the home page of the first session shows a banner : the keys are not backed up. This marker (date and commit) is written by just backup-admin once the key is complete ; backup skipped or failed, it stays absent.

The network is born with a main zone, with prefix 10.0 (10.0.0.0/16) if it is free, otherwise the first free one (10.x, 172.16 to 172.31, 192.168). The summary indicates it, and the choice is final.