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"?
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.
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)