New options not recognized when upgrading 19.09 to 20.03

The release notes for 20.03 say that some options have changed. For instance, the option i18n no longer exists; the options under it have moved to the option console. Accordingly, I changed my old configuration to this experimental new one, for instance replacing

  i18n = {
    consoleFont = "Lat2-Terminus16";
    consoleKeyMap = "us";
    ...

with

  console = {
    font = "Lat2-Terminus16";
    keyMap = "us";
    ...

When I run sudo nix-channel --list I see

  nixos https://nixos.org/channels/nixos-19.09

which seems to be what it should be. So then I ran these:

nix-channel --add https://nixos.org/channels/nixos-20.03 nixos
nix-channel --update
sudo nixos-rebuild --upgrade boot

The first two execute without complaint, but the last doesn’t recognize the new options. I get the report:

error: The option `console' defined in `/etc/nixos/configuration.nix' does not exist

So now I’m trying my old configuration.nix file, with the i18n options. NixOS appears to be happily rebuilding. (I just hope it doesn’t run out of space.)

What have I misunderstood?

1 Like

nix-channel controls the channels for your user but sudo nixos-rebuild will use root’s channels controlled by sudo nix-channel.

1 Like

That was the problem!

So I used sudo for everythiing and it worked. But now I’m left wondering: Given what I ran before, do I now have a separate non-sudo installation taking up space?

Yes, if the root’s and your channel point to different channel
revisions, you will have the channel twice. (Though Nix can partially
reduce it if you optimize your store.)

You can check their sizes using sudo du --dereference --summarize --human-readable /root/.nix-defexpr/channels/nixos. For me, it is
around 180 MB.

If you do not need your user profile to have a different channel than
root, you can remove it using nix-channel --remove nixos. (And then
do nix-collect-garbage to remove it from store.)

2 Likes

Done! Thank you so much, @jtojnar!