Files
DavHau 3d24dde515 clan machines update: boot first, then switch, detect inhibitors
Previously, `clan machines update` ran `switch-to-configuration switch`
directly and retried blindly on failure. When NixOS switch inhibitors
blocked the activation (e.g. dbus-implementation change), the command
failed twice with no useful guidance.

New activation strategy:
1. Run `switch-to-configuration boot` first — always registers the new
   generation in the bootloader, never blocked by inhibitors.
2. Try `switch-to-configuration switch` for live activation.
3. If switch fails due to inhibitors, report a clear error suggesting
   reboot instead of retrying. The new config is already registered
   for the next boot.
4. Non-inhibitor failures (SSH drops, transient errors) still retry once.

Also:
- Add `--no-check` CLI flag (equivalent to NIXOS_NO_CHECK=1) to force
  past switch inhibitors when the user knows it is safe.
- Forward NIXOS_NO_CHECK as KEY=VALUE (`-E NIXOS_NO_CHECK=1`) instead
  of bare `-E NIXOS_NO_CHECK` so the value survives the SSH hop.
- Add VM test case that triggers switch inhibitors and verifies:
  boot succeeds, switch is blocked, error suggests reboot, and
  NIXOS_NO_CHECK=1 forces past the inhibitor.
- Add unit tests for boot+switch flow, inhibitor detection,
  NIXOS_NO_CHECK forwarding, and --no-check flag.
2026-04-27 21:36:07 +02:00
..
2024-07-08 16:24:34 +02:00
2025-08-26 14:48:20 +02:00
2026-04-03 14:24:14 +02:00
2026-04-03 14:24:14 +02:00
2026-01-21 12:52:50 +01:00
2025-09-16 16:37:41 +07:00

clan-cli

The Clan CLI contains the command line interface.

Hacking on the CLI

We recommend setting up direnv to load the development with Nix. If you do not have it set up you can also use nix develop directly like this:

use flake .#clan-cli --builders ''

After you can use the local bin wrapper to test things in the CLI:

./bin/clan

Run locally single-threaded for debugging

By default tests run in parallel using pytest-parallel. pytest-parallel however breaks breakpoint(). To disable it, use this:

pytest -n0 -s

You can also run a single test like this:

pytest -n0 -s tests/test_secrets_cli.py::test_users

Run all checks in a sandbox

nix build .#checks.x86_64-linux.clan-pytest-with-core
nix build .#checks.x86_64-linux.clan-pytest-without-core