Warning: boot.enableContainers & virtualisation.containers unsupported?

After updating my nixpkgs to today’s nixos-22.05 (commit 058de3818), `nixos-rebuild reports

warning: Enabling both boot.enableContainers & virtualisation.containers on system.stateVersion < 22.05 is unsupported.

My config specifies virtualisation.libvirtd.enable = true and virtualisation.podman.enable = true. Docs indicate that boot.enableContainers = true by default.

What is the correct way to clear this warning? Does this mean it’s time to change my system.stateVersion = "21.05"?

2 Likes

Related section from the release notes:

The configuration and state directories used by nixos-containers have been moved from /etc/containers and /var/lib/containers to /etc/nixos-containers and /var/lib/nixos-containers.

If you are changing system.stateVersion to “22.05” manually on an existing system you are responsible for migrating these directories yourself.

This is to improve compatibility with libcontainer based software such as Podman and Skopeo which assumes they have ownership over /etc/containers.

It looks like it’s indeed time to change the state version, yay! I’m personally just going to drop my old directories. The reason this warning come up now, and not in the time of actually upgrading to 22.05 is because the warning was broken. Now it’s fixed.

1 Like

Thanks for the guidance; now I know better to look at the release notes for such info.

But what do I have to do to fix this warning?

My stateVersion is 19.09.

virtualisation.containers seems to be unset, as evaluating it errors, while my system still builds fine but does not error:

$ nix eval .\#nixosConfigurations.mimas.config.system.stateVersion
"19.09"
$ nix eval .\#nixosConfigurations.mimas.config.boot.enableContainers
true
$ nix eval .\#nixosConfigurations.mimas.config.virtualisation.containers
error: The option `virtualisation.containers.users' can no longer be used since it's been removed. All users with `isNormalUser = true` set now get appropriate subuid/subgid mappings.
(use '--show-trace' to show detailed location information)

Could it be that something else is setting it partially? Do you get an error when evaluating virtualisation.containers.enabled?

Oh, indeed, that is also true.

And now I even find it in the config now.

I didn’t find it the last time I tried… History says that I had a typo…

Thanks!

1 Like