{{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}} {{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}}

Installed

nixos-router
{{or $g.Router.Version "unknown"}}{{if $g.Router.Rev}} {{printf "%.7s" $g.Router.Rev}}{{end}}
Settings schema
{{$g.Router.Schema}}
NixOS
{{or $g.Version "unknown"}}

An upgrade brings the newest nixos-router{{if $g.Repository}} (from {{$g.Repository}}){{end}} and the packages (the kernel and all programs) of the channel you follow. 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.

{{if $g.ReleasesSeen}}

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

{{end}}

The channel only chooses which packages 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 or $g.Channel $g.Repository}}

Check

{{with $g.Check}}
{{with .Router}}
nixos-router
{{.Installed}}{{if .Newer}} → {{.Newest.Version}}{{else}} (the newest){{end}}
{{end}} {{if .Channel}}
Packages
{{.Channel}}: {{printf "%.7s" .Newest.Rev}}{{if .PackagesUpToDate}} (what runs){{else}} newer than the running {{printf "%.7s" .Running.Rev}}{{end}}
{{end}}
Checked
{{.Time}}
{{if .UpToDate}}

Up to date.

{{else}}

A newer version is available.

{{end}} {{end}}

What would change

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

Works it out from the new versions' descriptions: no package is downloaded.

{{with $g.Preview}}

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

{{if or .Router .Changes}} {{with .Router}}{{end}} {{range .Changes}}{{end}}
PackageNowNew
nixos-router{{.From}}→{{.To}}
{{.Name}}{{.From}}→{{.To}}
{{else}}

No package changes.

{{end}} {{if .Router}}

The highlighted row is the router software itself: this upgrade installs it too.

{{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{{with .Router}} nixos-router to {{.To}} and{{end}} 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}}

Install a bundle

For a router without a route to the repository, or when it is down: 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.

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

Last bundle 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 upgrade run{{if $g.Run.Result}} — {{if eq $g.Run.Result "success"}}succeeded{{else}}failed ({{$g.Run.Result}}){{end}}{{end}}

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