Publish auto-update package and NixOS module as a standalone flake #61

Closed
opened 2026-07-16 13:52:22 +01:00 by nimmo · 5 comments
Owner

Context

After the updater has a stable package/module boundary inside this repository, it may be valuable to publish it as a standalone Forgejo repository and flake. That would isolate its release cycle, make the implementation independently testable, and allow other NixOS configurations to consume it without copying scripts.

This work depends on #60. It must not begin until the in-repository extraction has been deployed and proven through a genuine update plus a no-op follow-up.

Scope

  • Create a dedicated Forgejo repository for the updater.
  • Export:
    • the updater package and both commands
    • a NixOS module
    • package checks and hermetic regression tests
    • formatter and development tooling where useful
  • Define a stable module API for host policy, repository location/owner, scheduling, switch execution, and notification integration.
  • Keep secrets external: accept file paths or module-provided values without owning this repository's SOPS layout.
  • Document runtime-state ownership, locking, failure stamps, detached helper units, recovery, and rollback.
  • Add standalone Forgejo CI for linting, evaluation, package builds, and regression tests.
  • Add the external flake as a pinned input to nixos-config and migrate the local module configuration.
  • Establish an update/release policy so automated flake updates cannot silently introduce incompatible updater behaviour.
  • Retain a simple rollback path to the last in-repository implementation during the initial adoption window.

Completion criteria

  • #60 is closed with live deployment evidence.
  • The standalone repository builds and tests without access to nixos-config secrets or host files.
  • Package and NixOS module outputs have documented interfaces.
  • CI blocks releases that fail lint, evaluation, or state-machine regressions.
  • nixos-config consumes an explicitly pinned revision.
  • Existing command names, runtime paths, service/timer names, hold behaviour, and notifications remain compatible or have a documented migration.
  • Electra, Vega, and Lyra evaluate and deploy using the external input.
  • A genuine update and immediate no-op follow-up succeed on the external package.
  • Rollback to the in-repository package has been tested or documented.
  • Repository ownership, maintenance expectations, and release/versioning policy are documented.

Dependency

Blocked by #60.

## Context After the updater has a stable package/module boundary inside this repository, it may be valuable to publish it as a standalone Forgejo repository and flake. That would isolate its release cycle, make the implementation independently testable, and allow other NixOS configurations to consume it without copying scripts. This work depends on #60. It must not begin until the in-repository extraction has been deployed and proven through a genuine update plus a no-op follow-up. ## Scope - Create a dedicated Forgejo repository for the updater. - Export: - the updater package and both commands - a NixOS module - package checks and hermetic regression tests - formatter and development tooling where useful - Define a stable module API for host policy, repository location/owner, scheduling, switch execution, and notification integration. - Keep secrets external: accept file paths or module-provided values without owning this repository's SOPS layout. - Document runtime-state ownership, locking, failure stamps, detached helper units, recovery, and rollback. - Add standalone Forgejo CI for linting, evaluation, package builds, and regression tests. - Add the external flake as a pinned input to `nixos-config` and migrate the local module configuration. - Establish an update/release policy so automated flake updates cannot silently introduce incompatible updater behaviour. - Retain a simple rollback path to the last in-repository implementation during the initial adoption window. ## Completion criteria - [ ] #60 is closed with live deployment evidence. - [ ] The standalone repository builds and tests without access to `nixos-config` secrets or host files. - [ ] Package and NixOS module outputs have documented interfaces. - [ ] CI blocks releases that fail lint, evaluation, or state-machine regressions. - [ ] `nixos-config` consumes an explicitly pinned revision. - [ ] Existing command names, runtime paths, service/timer names, hold behaviour, and notifications remain compatible or have a documented migration. - [ ] Electra, Vega, and Lyra evaluate and deploy using the external input. - [ ] A genuine update and immediate no-op follow-up succeed on the external package. - [ ] Rollback to the in-repository package has been tested or documented. - [ ] Repository ownership, maintenance expectations, and release/versioning policy are documented. ## Dependency Blocked by #60.
nimmo closed this issue 2026-07-20 15:24:54 +01:00
nimmo reopened this issue 2026-08-09 21:16:59 +01:00
Author
Owner

Reopened to resume the standalone flake extraction. Initial repository creation is blocked because the configured Forgejo token lacks the write:organization scope required to create nimmo/nixos-auto-update. Once a suitably scoped token/login is available, the first implementation step is to create that repository and migrate the already-extracted package, thin module, tests, docs, and CI before wiring it into this flake as a pinned input.

Reopened to resume the standalone flake extraction. Initial repository creation is blocked because the configured Forgejo token lacks the write:organization scope required to create nimmo/nixos-auto-update. Once a suitably scoped token/login is available, the first implementation step is to create that repository and migrate the already-extracted package, thin module, tests, docs, and CI before wiring it into this flake as a pinned input.
Author
Owner

Repository created: https://git.nimmog.uk/nimmo/nixos-auto-update. The initial standalone flake and its caller-owned secret-path module are published at 19b4d60; both standalone flake checks (including the VM state-machine test) passed. nixos-config now consumes that pinned revision on local branch tidy-auto-update-split-repo at c70b92f; nix flake check --no-build --accept-flake-config passed for Electra, Lena, Vega, Lyra, Cosmos, and Chaos. The configuration commit has not been pushed or deployed yet.

Repository created: https://git.nimmog.uk/nimmo/nixos-auto-update. The initial standalone flake and its caller-owned secret-path module are published at 19b4d60; both standalone flake checks (including the VM state-machine test) passed. `nixos-config` now consumes that pinned revision on local branch `tidy-auto-update-split-repo` at c70b92f; `nix flake check --no-build --accept-flake-config` passed for Electra, Lena, Vega, Lyra, Cosmos, and Chaos. The configuration commit has not been pushed or deployed yet.
Author
Owner

Follow-up local commit ae33ec9 removes the duplicate updater package, module, scripts, VM fixture, and local regression fixture from nixos-config. The Attic producer now resolves its shared update-policy library from the pinned external package (currently nixos-auto-update 3a63eda), and the local flake re-exports the external package/check. nix flake check --no-build --accept-flake-config and bash -n scripts/attic-cache-build.sh pass. The branch remains local and unpushed.

Follow-up local commit ae33ec9 removes the duplicate updater package, module, scripts, VM fixture, and local regression fixture from `nixos-config`. The Attic producer now resolves its shared update-policy library from the pinned external package (currently `nixos-auto-update` 3a63eda), and the local flake re-exports the external package/check. `nix flake check --no-build --accept-flake-config` and `bash -n scripts/attic-cache-build.sh` pass. The branch remains local and unpushed.
Author
Owner

Post-merge fleet validation

The pinned external updater is now deployed and its scheduled consumer runs have been observed:

  • Vega: successful no-op at 22:00:26 BST; deployed revision a4a9ad1.
  • Electra: successful no-op at 22:11:26 BST; deployed revision a4a9ad1.
  • Lyra: successful build and detached-switch handoff at 22:12:38 BST; running revision a4a9ad1.
  • Cosmos: successful build and detached-switch handoff at 22:05:06 BST; running revision a4a9ad1.
  • Chaos: successful build and detached-switch handoff at 22:10:17 BST; running revision a4a9ad1.

Lena did not respond over Nebula during verification, likely asleep/offline, so it remains unverified.

## Post-merge fleet validation The pinned external updater is now deployed and its scheduled consumer runs have been observed: - Vega: successful no-op at 22:00:26 BST; deployed revision `a4a9ad1`. - Electra: successful no-op at 22:11:26 BST; deployed revision `a4a9ad1`. - Lyra: successful build and detached-switch handoff at 22:12:38 BST; running revision `a4a9ad1`. - Cosmos: successful build and detached-switch handoff at 22:05:06 BST; running revision `a4a9ad1`. - Chaos: successful build and detached-switch handoff at 22:10:17 BST; running revision `a4a9ad1`. Lena did not respond over Nebula during verification, likely asleep/offline, so it remains unverified.
Author
Owner

Lena is intentionally out of scope for closure because it is rarely online. The required external-updater deployment and scheduled-run evidence is complete for Vega, Electra, and Lyra; the observed Cosmos and Chaos runs provide additional coverage.

Lena is intentionally out of scope for closure because it is rarely online. The required external-updater deployment and scheduled-run evidence is complete for Vega, Electra, and Lyra; the observed Cosmos and Chaos runs provide additional coverage.
nimmo closed this issue 2026-08-09 22:30:47 +01:00
Sign in to join this conversation.
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
nimmo/nixos-config#61
No description provided.