Creating a project by hand
Manual route, without the ISO or darkone new (which writes all of this for
you, see Initial installation).
It starts from an administration machine that is already a DNF host. The project
comes from the template provided by the framework : a ready-made structure and a
commented etc/config.yaml to fill in.
Create the project
Section titled “Create the project”-
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. Alternative : the GitHub template dnf-boilerplate 🡕 (“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-hostIdempotent : creates the age keys, the
.sops.yamlfile, the reference password and the internal secrets of the declared services, without ever recreating what already exists. Run it again after each new service, host or zone.
Describe the configuration
Section titled “Describe the configuration”Everything is declared in etc/config.yaml (network, zones, users, hosts).
For a first machine, one zone, one user and one host are enough : 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 each 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"var/generated/ is produced by the tool : you edit etc/config.yaml,
never this folder. just generate also seeds usr/users/<login>/ for each
account and usr/machines/<host>/ (configuration.nix, install/disko.nix)
for each host with a disko block.
All that remains is to install the host : see Add a machine.