I’ve made some changes to my config that my container isn’t picking up (I changed the uid of the user it’s supposed to create, but it’s not getting changed). Now I want to destroy and rebuild it since its state doesn’t match what I defined, but the command line tool won’t let me:
# nixos-container destroy files
/run/current-system/sw/bin/nixos-container: cannot destroy declarative container (remove it from your configuration.nix instead)
Do I really have to make a fake change to my config just to get it to destroy the container, then revert the change to get it back?
This is going to be important going forward, because I’ve found that containers have a nasty habit of accumulating state that I’d prefer to purge from time to time by rebuilding them.
Update: I tried removing the config for the container, rebuilding, putting the config back, rebuilding. But it still won’t purge the container state. Even remove, rebuild, GC, put back, rebuild doesn’t work! How do I get my container back to its original state?