{{define "content"}}
{{$u := .Data.Update}}{{$g := .Data.Upgrade}} {{if $u.Status.Running}} {{else if $g.Run.Running}} {{else if $u.Pending}}

Waiting for confirmation

A new system is active and not confirmed yet. Confirm it on the Overview, or the router goes back to the previous one.

{{end}}

Router software

Installed

Version
{{or $u.Installed.Version "unknown"}}{{if $u.Installed.Rev}} {{$u.Installed.Rev}}{{end}}
Settings schema
{{$u.Installed.Schema}}

Install a bundle

A .bundle file made with nix run .#release. It is installed only if it is signed with this router's update key. The settings are kept (and migrated if the new version needs it); the new version must be confirmed afterwards, or the router goes back.

Update server

{{if $u.URL}}
{{end}} {{if $u.OfferErr}}

Could not check: {{$u.OfferErr}}

{{end}} {{with $u.Offer}}

{{if .Newer}}Available: {{.Version}}{{if .Rev}} {{.Rev}}{{end}}.{{else}}Nothing newer: the server has {{.Version}}.{{end}}

{{if not .Newer}}

{{end}}
{{end}}

The server only has to serve static files: the latest file and cache/ that nix run .#release writes. The data is signed, so plain HTTP works too.

Packages

{{with $g.NewerRelease}}

NixOS {{.}} is out

You follow {{$g.Channel}}. {{.}} is the newer stable release: switch the channel to it, then look for upgrades and preview what would change. Nothing is installed until you upgrade, and NixOS cannot go back to the older release afterwards.

{{end}}

Channel

Upgrades the kernel and all programs (NixOS) without a new release of nixos-router. Nothing is downloaded until you ask for it, and an upgrade is activated like a settings change: unless you confirm it in time, the router goes back to the previous system.

Running
{{or $g.Version "unknown"}}
{{if $g.ReleasesSeen}}

Stable releases as the channel server listed them on {{$g.ReleasesSeen}}; Check for upgrades asks again.

{{end}}

The channel only chooses what an upgrade offers; saving it changes nothing on the router. Going back to an older release (unstable to 26.05) is refused unless you tick "downgrade anyway" when previewing; state written by the newer release may not work with the older one.

{{if $g.Channel}}

Check

{{with $g.Check}}
Channel
{{.Branch}}
Running
{{.Running.Version}}
Newest
{{printf "%.7s" .Newest.Rev}} checked {{.Time}}
{{if .UpToDate}}

Up to date.

{{else}}

A newer revision is available.

{{end}} {{end}}

What would change

{{if and $g.Check $g.Check.UpToDate}}{{end}}

Works it out from the new revision's description: no package is downloaded.

{{with $g.Preview}}

{{$g.Version}} → {{.Version}} {{printf "%.7s" .Rev}}, previewed {{.Time}}

{{if .Changes}} {{range .Changes}}{{end}}
PackageNowNew
{{.Name}}{{.From}}→{{.To}}
{{else}}

No package changes.

{{end}}

The list shows the versions of programs the router runs; a program that is only rebuilt does not appear.

To download
{{or .Download "nothing, or the package cache cannot be reached"}}
Built here
{{.Builds}} derivation{{if ne .Builds 1}}s{{end}}{{if gt .Builds 50}} (many: the package cache may not have them yet; this takes long){{end}}
{{if .RebootNeeded}}
Kernel
A new kernel: it runs after the next reboot.
{{end}}
{{if .BuildNames}}
What is built here

The system's own pieces (they carry the nixpkgs revision) and programs the package cache does not have yet.

    {{range .BuildNames}}
  • {{.}}
  • {{end}}
{{if .MoreBuilds}}

… and {{.MoreBuilds}} more

{{end}}
{{end}}
Upgrade to {{.Version}}

Downloading first lets you start the upgrade later without needing the internet. Upgrading downloads what is missing, builds the system and switches to it; confirm it on the Overview.

{{end}}
{{else}}

Choose a channel to look for upgrades.

{{end}} {{if and $u.Status.Log (not $u.Status.Running)}}

Last update{{if $u.Status.Result}} — {{if eq $u.Status.Result "success"}}succeeded{{else}}failed ({{$u.Status.Result}}){{end}}{{end}}

{{$u.Status.Log}}
{{end}} {{if and $g.Run.Log (not $g.Run.Running)}}

Last package run{{if $g.Run.Result}} — {{if eq $g.Run.Result "success"}}succeeded{{else}}failed ({{$g.Run.Result}}){{end}}{{end}}

{{$g.Run.Log}}
{{end}}
{{end}}