Skip to content

Just Commands

The commands below are all executed with just 🡕.

Usage
just <command> <arguments>

Each command is prefixed with an icon indicating its usage context:

  • 💠 Common: available in all contexts.
  • 🔆 Framework: specific to the upstream DNF framework (dnf/).
  • ✳️ Project: specific to the consuming project (my network).
  • 🔗 Co-development: consuming project that contains a clone of the framework.

The recipes live in dnf/just/. The project Justfile imports one bootstrap file, which determines the available commands depending on the context.

ContextJustfile lineCommands
Frameworkimport 'just/dnf.just'💠 🔆
Consumer projectimport? 'dnf/just/project.just'💠 ✳️
Co-developmentimport 'dnf/just/codev.just'💠 ✳️ 🔗

In a consumer project, dnf/ is the symlink to the Nix store created by nix run .#init. The ? in import? lets just start as long as this symlink does not exist.

Co-development replaces this link with a git clone of the framework. The recipes 🔆 unit-tests, check-recipes, simulate, simulate-debug, fixtures and pkg-update can also be run there from the root. Project templates include the codev.just line, commented out.


Common to all contexts, these commands help maintain the code and generate declarative files.

Runs nix develop -c zsh to get a shell with the project tools.

Fenêtre de terminal
just develop

Runs the full chain: statix fix → check-code → generate → format → _fix_fs_permissions.

Fenêtre de terminal
just clean

Runs treefmt on all files using the shared framework config. In co-development, also formats dnf/.

Fenêtre de terminal
just format

Regenerates the default.nix files of module folders and, in a project, the var/generated/*.nix files from etc/config.yaml. It also seeds usr/machines/<host>/ for each host with a disko block (see Machine folder).

Fenêtre de terminal
just generate

Run these checks before deploying to catch regressions.

Runs code verification (check-code), DNF unit tests and flake verification (check-flake). Unit tests only run on a framework clone: a dnf/ symlinked to the store was tested before publication.

Fenêtre de terminal
just check

Static analysis with statix and dead code detection with deadnix, on all *.nix files. shellcheck checks *.sh scripts tracked by git, including those in dnf/ during co-development.

The statix rules are in statix.toml at the project root, provided by the project template: repeated_keys disabled, as files in usr/ group home.* keys by topic. An older project without this file adds it manually. The framework has its own, dnf/statix.toml, which also ignores backports/; its CI gets its lint tools from flake.lock, so it uses the same versions as locally.

Fenêtre de terminal
just check-code

Runs nix flake check while filtering known warnings from DNF’s non-standard outputs (colmena, colmenaHive, homeManagerModules, libTests, mkNodes, secretsPlan, version).

Fenêtre de terminal
just check-flake

In the framework repository (dnf/). Tests and pkg-update also run from the root of a co-development project.

Runs nix-unit on the framework’s libTests tests.

Fenêtre de terminal
just unit-tests

Verifies that the three bootstraps (dnf, project, codev) load correctly, and that each nested just <recipe> call resolves to a recipe from its own context. just only resolves these calls at runtime: CI runs the same verification.

Fenêtre de terminal
just check-recipes

Runs NixOS test scenarios (NixOS Test Driver).

ArgumentEffect
(empty)Lists available scenarios
allRuns all scenarios (nix flake check)
fullRegenerates fixtures then runs everything
<name>Runs a named scenario
Fenêtre de terminal
just simulate # list
just simulate all # run all
just simulate modules-node-console-git

Runs the interactive driver of a scenario (Python REPL).

Fenêtre de terminal
just simulate-debug modules-node-console-git

Manages test fixtures: generation, drift check, regeneration of disposable keys and secrets.

ActionEffect
generateRegenerates var/generated/ for all test environments
checkChecks for drift without modifying the tree
gen-secretsRegenerates disposable test keys and secrets
Fenêtre de terminal
just fixtures check

🔆 test-installer [scénario] [iso] [générateur]

Section titled “🔆 test-installer [scénario] [iso] [générateur]”

Tests the installation ISO in a QEMU VM : the darkone new wizard is driven end to end there. Allow 30 minutes and 25 GB of disk per scenario, one minute for preflight. See Testing the installer.

ScenarioInstallation
preflightNone, pre-checks only
scriptedAnswer file, unencrypted disk
interactiveConsole prompts, encrypted disk
resumeLink dropped, Ctrl-C, then resume
all (default)All four
gatewayOutside all : admin workstation, then darkone add gateway on a second machine

générateur : a local copy of dnf-generator, on which the ISO is built ; gateway requires one that has darkone add gateway.

Fenêtre de terminal
just test-installer
just test-installer interactive /chemin/de/l.iso
just test-installer gateway '' chemin/de/dnf-generator

Opens the installation ISO of this tree in a QEMU window. The project written by the assistant follows the local tree, unpublished code included. reset starts over with a new disk.

Fenêtre de terminal
just try # disque gardé
just try reset chemin/de/dnf-generator # disque neuf, générateur local

Updates a package from dnf/pkgs/ to its latest upstream version, or to version if given, using nix-update 🡕. See Packages outside nixpkgs.

Fenêtre de terminal
just pkg-update rename-simple
just pkg-update fleet-update 0.2.0 # explicit version (release train)

Lists temporary workarounds with their upstream status and flags those to remove. See Temporary workarounds.

Fenêtre de terminal
just workarounds

Displays the framework version, its revision, its latest tag, and the generator release it pins.

Fenêtre de terminal
just version

Displays what the next release entry would look like, without writing anything. Requires git-cliff, provided by the devShell (just develop).

Fenêtre de terminal
just changelog

Bumps the version, adds the CHANGELOG entry, commits and tags the framework, without pushing. See Publishing a release.

Fenêtre de terminal
just bump # level inferred from commits

Installing a new host follows a precise sequence.

Formats the disks via disko and installs NixOS via nixos-anywhere.

The ip argument defaults to auto : the address is computed as for full-install, no need to look it up.

Before formatting, the recipe reports what would make the rest fail, then asks for confirmation :

AlertWhat to do
Host name unknown to the workstationjust apply <passerelle locale>
HCS not up to date for the hostjust apply hcs
Encrypted host outside any zoneAlso forward port 2222

Before the very first question, it also lists the uncommitted changes outside the host : they will go into its commits.

The recipe also drops onto the target, before the system installation, the age key /etc/sops/age/infra.key (except on an isolated host) and, on an encrypted host, the SSH host key of its initrd : sops works from the first activation and the very first boot already listens on port 2222. The volume is formatted with the fleet’s shared passphrase, so there is nothing to type.

On an isolated host, it first seals its usr/secrets/hosts/<hôte>.yaml file for the installer’s host key, which the installed system takes over : the build finds it, without going through just space-init.

Fenêtre de terminal
just install myserver
just install myserver nixos 10.0.0.5 # IP personnalisée
just install myserver nix auto test # VM test uniquement

With the nixos user (ISO), the recipe pairs the machine itself : it reads its host key, asks for the pairing code if one is needed, then runs the whole installation in a tunnel held to that key (copy, formatting, secrets) : another machine at the same address makes the recipe fail. See Gateway.

Two environment variables are used by darkone add gateway :

VariableEffect
DNF_INSTALL_CONFIRMED=1skips the disk formatting question
DNF_PAIR_HOSTKEY=<clé>rejects any other host key, before any secret and any formatting

DNF_PAIR_HOSTKEY requires the nixos user (no pairing otherwise). The pre-check’s Continue anyway? question is still asked.

nixos-anywhere and disko are the ones pinned by the framework, tested with it : nix run .#nixos-anywhere and nix run .#disko from the project.

✳️ full-install <hôte> [user] [ip] ⭐

Section titled “✳️ full-install <hôte> [user] [ip] ⭐”

Full chain : install + wait for reboot + unlock + configure + apply + gc + reboot.

The starting address is computed on its own : the host name in its own zone, the reserved transit address if it is plugged in elsewhere. See Machines outside their zone.

After the reboot, the machine has not necessarily come back to the same place : the recipe probes all its known addresses, on ports 22 and 2222, and continues on the one that answers. An encrypted host is unlocked along the way by just unlock.

The final reboot is not decorative : apply activates the user space but not the kernel or the initrd, and this reboot is the only automatic proof that the machine comes back on its own. On an encrypted host, it proves at the same time that remote unlocking works, while you are still in front of it and not at the first power outage. unlock is therefore called again right after.

For its zone’s gateway, installed from a workstation plugged into the box, the recipe stops after installation and asks you to plug the workstation into a LAN port on the gateway : it resumes on its own (waiting up to 30 minutes). See Gateway.

Fenêtre de terminal
just full-install myserver
just full-install myserver nixos 10.0.3.42 # adresse forcée

Formats a USB device with disko and installs NixOS on it. Seals the host like install.

Fenêtre de terminal
just install-key myusbhost

✳️ install-here <hôte> <login> [empreinte] [yes] [passphrase] [cache] [clé]

Section titled “✳️ install-here <hôte> <login> [empreinte] [yes] [passphrase] [cache] [clé]”

Installs the machine it runs on, booted from the generic DNF ISO, as the project’s administration workstation: disk o erases its disk, the keys are born on the target (bootstrap-keys), then nixos-install. The project joins the new system’s /etc/nixos, owned by login. An encrypted disk requires the file for its passphrase, which becomes the fleet’s shared passphrase; the initrd SSH key is placed on the target.

cache and clé: an additional package cache and its public key, for this installation only (passed by darkone new).

Fenêtre de terminal
just install-here poste alice '<empreinte>'

✳️ backup-admin <périphérique> [passphrase] [racine]

Section titled “✳️ backup-admin <périphérique> [passphrase] [racine]”

Writes to a USB key, without formatting it, an age-encrypted backup of what nothing else replaces: the nix deployment key (which gives the admin age key), the infra age key and the project (git bundle). File dnf-backup-<domaine>.tar.age, with a plain README.txt; a previous backup of the same network is kept, renamed with its date.

  • périphérique: a partition of the key, /dev/disk/by-label/SECOURS for example;
  • passphrase: a file containing it; otherwise, age asks for it;
  • racine: the system holding the keys, /mnt from the installer.

darkone new runs it after installation.

Fenêtre de terminal
just backup-admin /dev/disk/by-label/SECOURS

✳️ backup-check <périphérique> [passphrase] [racine]

Section titled “✳️ backup-check <périphérique> [passphrase] [racine]”

Reads back the backup-admin backup, same arguments, and compares it to the keys and the latest commit of the project.

Chains copy-id → copy-hw → push-key → luks (the last one does nothing on a non-encrypted host).

The address is resolved once and passed to the whole chain. If the host is plugged outside its zone, the SSH redirection is set up in the process, so that the following apply reaches it: just roaming-clear <host> once the machine is back home.

Fenêtre de terminal
just configure myserver

Checks that the nix deployment key can open the target host, and pushes the shared private key to gateways (TLS certificate synchronization from the HCS).

Fenêtre de terminal
just copy-id myserver

Runs nixos-generate-config --show-hardware-config remotely and saves the result in usr/machines/<host>/hardware/hardware-configuration.nix, then chains detect-hw.

Fenêtre de terminal
just copy-hw myserver

Collects on the machine the kernel modules of its wired network cards and writes them to usr/machines/<hôte>/hardware/detected-hardware.nix (generated file, imported automatically). They join the initrd only if it has network, for remote LUKS unlocking. Also detects a virtual machine (systemd-detect-virt): no firmware is loaded on it (darkone.system.hardware.virtual). Called by install (nixos user of the ISO) and by copy-hw.

Fenêtre de terminal
just detect-hw myserver

Transfers the age key /etc/sops/age/infra.key to the target host, unless it does not read it (isolated host).

Fenêtre de terminal
just push-key myserver

Inventories a machine to declare it in etc/config.yaml before installing it :

  • the system (UEFI or BIOS, virtualization, memory) ;
  • the network cards (name, MAC, link, addresses, WAN card) ;
  • the disks, with the by-id path to copy into disko.devices ;
  • the MAC address of the card that carries the default route, the one to declare (otherwise the first wired card with a link, with a warning).

Useful when the host does not yet have a DHCP reservation and is therefore reachable only through the dynamic address shown on its screen. The recipe tries the nix account, then nixos (installer) by pairing the machine : on the generic ISO, it asks for the pairing code displayed on screen. See Gateway.

Fenêtre de terminal
just host-info myserver 10.0.0.50

Provisions an encrypted host : shared and per-host passphrases in sops, initrd SSH key in sops then on the target, usr/secrets/luks.json manifest, WAN IP of the gateways. See Disk encryption (LUKS).

ActionEffect
(default)Prepares the secrets, then converges the machine
preOffline half only, without touching the machine
passwdRotates the per-host passphrase, then converges (immediately for an isolated host)
showRead-only audit : keyslots and remote unlocking
Fenêtre de terminal
just luks myserver
just luks myserver show
just luks myserver passwd

Redirects SSH to a host connected outside its zone, for the duration of the installation. Colmena addresses a node by its name, which refers to its original address; this redirect points it to where the machine actually is.

Set up by just configure when needed, removed by full-install at the end of the run. Without arguments, displays the current redirects.

Fenêtre de terminal
just roaming # display
just roaming myserver # redirect (computed address)

Removes a host’s redirect, or all of them if none is given.

Fenêtre de terminal
just roaming-clear myserver
just roaming-clear

Configures the administration machine: SSH keys, SOPS age keys, .sops.yaml, Harmonia signing key, and all internal secrets required by the declared services (OAuth2 clients, backup, service tokens…).

Fenêtre de terminal
just configure-admin-host

Enrolls a host in the tailnet with a single-use key, carrying the declared tags. Safe to rerun : an already enrolled host is left as is. See Enroll a machine.

Fenêtre de terminal
just tailnet-enroll gw

✳️ bootstrap-keys [racine] [login] [empreinte]

Section titled “✳️ bootstrap-keys [racine] [login] [empreinte]”

Creates the keys and the sops skeleton of a machine that has no nix account yet, under the given root (/, or /mnt from the installer). configure-admin-host relies on the same mechanism. The fingerprint of an account (mkpasswd, in single quotes) is optional.

Fenêtre de terminal
just bootstrap-keys /mnt alice '<empreinte>'

Builds the installation ISO image for the given architecture. It bundles the administration public key (usr/secrets/nix.pub): just full-install connects to it without a password.

Fenêtre de terminal
just build-iso # x86_64-linux (default)
just build-iso "aarch64-linux"

The apply* commands rely on colmena 🡕 and first refresh the DNF lock via update-dnf. fleet-update drives a full update using native Nix commands.

Deploys the configuration on one or more targets.

ParameterDescription
targetHostname, glob ('*'), list (a,b), colmena tag (@server)
actionswitch (default), boot, test, build
Fenêtre de terminal
just apply @all # all hosts
just apply myserver # switch (default)
just apply myserver boot # boot
just apply 'db-*' # all hosts starting with db-

Same as apply with --verbose --show-trace.

Fenêtre de terminal
just apply-verbose myserver

Applies the configuration on the current machine.

Fenêtre de terminal
just apply-local

Enables Alertmanager maintenance mode before applying, disables it after.

Fenêtre de terminal
just apply-silenced myserver

Updates, builds and deploys the entire fleet in waves. See Update the fleet with fleet-update.

Fenêtre de terminal
just fleet-update # tout le parc, interface interactive
just fleet-update --on '+server' # les hôtes d'un profil
just fleet-update --build-only # construire sans rien activer
just fleet-update --help # toutes les options

Updates the root flake inputs. In co-development, updates dnf/ inputs first and commits them (chore(flake):, amended if the latest dnf/ commit is already one).

Fenêtre de terminal
just update-flake

Syncs flake.lock with the local HEAD of dnf/ (co-development).

Fenêtre de terminal
just update-dnf

These commands interact with fleet hosts: maintenance, reboot, cleanup, and boot repair.

Opens an interactive SSH session as nix@<hôte>, on port 22 only. A host outside its zone is located by dnf-locate (see Joining a host while travelling). A host waiting for its LUKS passphrase falls under just unlock.

Fenêtre de terminal
just enter myserver

Answers the LUKS prompt of a host left in its initrd, without a human : the passphrase is read from sops and pushed by the sshd on port 2222. Waits for the host to appear (one dot per attempt), which allows chaining it right after a reboot. Called automatically by just full-install. No stored passphrase accepted : from a terminal, the prompt is presented.

Nothing is sent to an initrd whose host key is not the one from sops. See LUKS encryption.

On a host without a LUKS volume, it is a logged no-op.

Fenêtre de terminal
just unlock myserver

✳️ remote-desktop <host> [ro|rw|login|stop] / rd ⭐

Section titled “✳️ remote-desktop <host> [ro|rw|login|stop] / rd ⭐”

Opens the remote desktop of a host. ro (default) observes the already open graphical session, rw takes control of it; both fail if no one is logged in. login instead opens your own session behind a GDM login screen. stop disarms a session left open. No port is opened on the host: the stream goes through an SSH tunnel mounted by nix. See Remote desktop.

Fenêtre de terminal
just rd mypc # observation
just rd mypc rw # prise en main
just rd mypc login # session à soi, via GDM
just rd mypc stop # désarmer une session restée ouverte

Reboots the host via colmena exec.

Fenêtre de terminal
just reboot myserver
just reboot 'web-*' # all web-*

Shuts down (poweroff) the host via colmena exec, after confirmation.

Fenêtre de terminal
just halt myserver

Removes old generations, cleans the store, then regenerates the boot entries (switch-to-configuration boot). keep sets what is retained:

keepGenerations retained
(empty)Current only, all profiles (nix-collect-garbage -d)
N (1 to 99)Last N system generations, current included
Nd (1 to 99)Those less than N days old, plus the active one on that date
Fenêtre de terminal
# Clean hosts whose name starts with "server-"
just gc "server-*" # Keep only the current generation
just gc "server-*" 3 # Keep the last 3 generations, current included
just gc "server-*" 3d # Remove generations older than 3 days

Cleans up the home directories of a host removed from the NFS share: dead XDG symlinks removed, .bak backups restored. check (default) writes nothing and shows what apply would do. hosts is a comma-separated list, or all. See Leaving the NFS home share.

Fenêtre de terminal
just nfs-cleanup myserver # dry run, writes nothing
just nfs-cleanup myserver apply # actual execution

Reinstalls the bootloader with NIXOS_INSTALL_BOOTLOADER=1.

Fenêtre de terminal
just fix-boot myserver

✳️ fix-gdm-greeters <hôtes> [check|apply]

Section titled “✳️ fix-gdm-greeters <hôtes> [check|apply]”

Realigns the UIDs of gdm-greeter* accounts with those of nixpkgs. See Troubleshooting.

Fenêtre de terminal
just fix-gdm-greeters poste-01,poste-02 # diagnostic, n'écrit rien
just fix-gdm-greeters poste-01,poste-02 apply

Passwords and keys are encrypted with SOPS. These commands manage them without manipulating encrypted files by hand.

Opens usr/secrets/secrets.yaml in vim (as user nix).

Fenêtre de terminal
just sops

Welcomes a user or resets their access: session password, Kanidm link, vault invitation, welcome sheet to copy. An already defined access is only replaced after confirmation.

ModeForKanidm link
normal / n (default)Non-technical1 h, for the admin
advanced / aTechnical24 h, for the user
Fenêtre de terminal
just invite alice # non-technical
just invite alice advanced # technical
just invite alice a '<hash>' # technical, fingerprint sent remotely

See Create a user account.

Updates a user’s session password, or records the fingerprint they sent (mkpasswd -m sha-512, in single quotes).

Fenêtre de terminal
just passwd darkone
just passwd darkone '<fingerprint>'

Enrolls a YubiKey (main by default, or backup) for a user: PAM (session/sudo), LUKS and Kanidm enrollment link, in a single pass on the admin workstation. Adds one press per encrypted isolated host, with that host’s salt : rerun with an already enrolled key, it only computes what it is missing. action=revoke revokes the key across the fleet on the next deployment. See Strong authentication.

Fenêtre de terminal
just yubikey darkone # enrôle la clé principale
just yubikey darkone backup # enrôle la clé de secours
just yubikey darkone main revoke

Rotation of the age key /etc/sops/age/infra.key in 3 steps with integrity checks.

StepAction
initGenerates a new key, keeps the old one, re-encrypts the secrets
push-keysPushes the combined key (new + old) to all hosts
finalizeVerifies that all hosts have the new key, removes the old one

Isolated hosts are ignored : they do not read this key.

Fenêtre de terminal
just rotate init
just rotate push-keys
just rotate finalize

Prépare un hôte isolé : clé d’hôte, fichier usr/secrets/hosts/<hôte>.yaml chiffré pour la clé admin et cette clé seule, secrets internes. Sur un espace IA avec openclaw, et si le réseau a Matrix, crée aussi son bot @<hôte>:<domaine> (compte MAS, jeton dans les secrets de l’espace, marqueur var/generated/spaces/<hôte>.nix). Relançable sans risque.

Fenêtre de terminal
just space-init espace1

Opens an isolated host’s secrets in vim (via the nix user).

Fenêtre de terminal
just space-sops espace1

These commands cover specific features: provisioning the Matrix alert bot and managing Kanidm replication.

Creates or refreshes the Matrix bot, the webhook secret, and the alert and incident channels from the network.matrix section of config.yaml. The bot account is created on the Matrix host with dnf-mas, via SSH.

Fenêtre de terminal
just configure-alert-bot

Sends a message to an alert channel (warnings or incidents), Markdown body on standard input. Channels and token come from the project : the caller only writes the text. Exit codes : 10 nothing configured, 11 message rejected by the server.

Fenêtre de terminal
just send-msg warnings < rapport.md

Collects Kanidm replication certificates from all fleet nodes into usr/secrets/replication/.

Fenêtre de terminal
just idm-sync-certs

Analyzes the health of Kanidm replication without modifying anything. Takes the supplier node (HCS) and the list of consumers (gateways, comma-separated).

Fenêtre de terminal
just idm-fix-replica hcs agate,gw

At the root of a co-development project. Git commands operate on all repositories of the project (default: src/*/, dnf, doc, and the root). The short alias for git is g.

Runs any git command on one or all projects.

Fenêtre de terminal
just git "log --oneline -5" # latest commits of all projects
just git "status" dnf # git status on dnf/ only
just git "remote -v" # remotes of all projects

add -A + commit -m on one or all projects. If the message is identical to the latest commit, the recipe amends instead of creating a new commit.

On all projects, the root is processed last, after update-dnf: its commit pins the revision of dnf/ that was just committed.

Fenêtre de terminal
just commit "fix(net): update dns config"
just commit "fix(net): update dns config" dnf # dnf/ only

Adds the current changes to the latest commit of each project (--no-edit). On all projects, the root lock is then realigned to dnf/.

Fenêtre de terminal
just amend

Displays the git status of one or all projects.

Fenêtre de terminal
just status

Displays the git diff of one or all projects.

Fenêtre de terminal
just diff

Checks for an upstream branch and ahead commits before pushing.

Fenêtre de terminal
just push

Pulls the latest changes for one or all projects.

Fenêtre de terminal
just pull

Displays the latest commit message for all projects, formatted and aligned.

Fenêtre de terminal
just git-last-log

Displays the list of repositories that git commands iterate over.

Fenêtre de terminal
just git-show-repos

Builds the generator binary (src/generator/).

Fenêtre de terminal
just gen-build

Runs the generator unit tests.

Fenêtre de terminal
just gen-test

Regenerates dnf/config/config.schema.json with the local generator. The release pipeline then rewrites it with the pinned generator.

Fenêtre de terminal
just gen-schema

Chains clean → amend → apply-local test (or apply-verbose <host>).

Fenêtre de terminal
just cat # tests locally
just cat myserver # applies on myserver

Compares each host’s derivation between a revision of dnf/ (base, HEAD by default) and its working tree. Exits with an error if any differs. See Neutral refactor.

Fenêtre de terminal
just drv-diff # tout le parc
just drv-diff gw-main,nas # deux hôtes

Displays the version, latest tag and branch of each repository, along with the generator release pinned by the framework.

Fenêtre de terminal
just versions

Publishes the whole ecosystem (generator, fleet-update, framework, documentation and project templates) after checks and simulations. See The release train.

Fenêtre de terminal
just release

AliasCommandContext
aapply✳️
alapply-local✳️
avapply-verbose✳️
cclean💠
ddevelop💠
eenter✳️
ggit🔗
amendgit-amend🔗
commitgit-commit🔗
diffgit-diff🔗
pullgit-pull🔗
pushgit-push🔗
statusgit-status🔗
rdremote-desktop✳️