Update from a git repository

router.update.repository names a public repository whose tags vX.Y.Z are
releases. router-update check (daily, and from the Updates page) looks for a
newer one and the Overview says so; router-update --git builds the router
from a tag like a bundle update: the settings are migrated, the new version
must be confirmed, the nixpkgs pin stays. The flake of such a router comes
from the release's config-flake.nix. The global flake registry is off.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-25 08:57:00 +01:00
co-authored by Claude Sonnet 5.5
parent a2dbeb5dea
commit 3fc54e678e
13 changed files with 589 additions and 26 deletions
+22
View File
@@ -0,0 +1,22 @@
# The flake.nix of an installed router's configuration directory when its
# nixos-router comes from a git repository (router.update.repository).
# `router-update --git` writes it with @SOURCE@ replaced by the address of the
# release it installs (git+URL?ref=refs/tags/vX.Y.Z&rev=COMMIT), so the lock
# file and this file always agree and nothing moves to a newer commit by itself.
#
# The release (version, commit time, settings schema) is the flake's own: an
# input from git has its commit, unlike the `path:` input of a bundle's flake.
#
# This is a contract between the updater that is installed and the release it
# installs: change it only in a way every earlier updater can still write.
{
inputs.nixos-router.url = "@SOURCE@";
outputs =
{ nixos-router, ... }:
{
nixosConfigurations.router = nixos-router.lib.mkRouterSystem {
settings = ./settings.json;
modules = if builtins.pathExists ./local.nix then [ ./local.nix ] else [ ];
};
};
}