sudo nixos-rebuild switch --upgrade
unpacking channels...
error: failed to open archive: Unrecognized archive format
(use '--show-trace' to show detailed location information)
building Nix...
error: failed to open archive: Unrecognized archive format
error: failed to open archive: Unrecognized archive format
error: failed to open archive: Unrecognized archive format
/tmp/nixos-rebuild.9ljtSS/nix
error: failed to open archive: Unrecognized archive format
building the system configuration...
error: failed to open archive: Unrecognized archive format
[think@nixos:~]$ sudo nixos-rebuild switch --upgrade --show-trace
unpacking channels...
error:
… while realising the context of a path
at «string»:1:6:
1| with import <nixpkgs/nixos> {}; config.system.build.nixos-rebuild
| ^
error: failed to open archive: Unrecognized archive format
building Nix...
error: failed to open archive: Unrecognized archive format
error: failed to open archive: Unrecognized archive format
error: failed to open archive: Unrecognized archive format
/tmp/nixos-rebuild.lhpCjD/nix
error: failed to open archive: Unrecognized archive format
building the system configuration...
error: failed to open archive: Unrecognized archive format
This looks like the downloaded channel info is corrupted. Wait a few hours and retry.