-
-
Notifications
You must be signed in to change notification settings - Fork 13.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos-container: Use new configuration & state directories #87268
nixos-container: Use new configuration & state directories #87268
Conversation
This is only really gonna fix podman etc. for all new NixOS installations. Existing installations will still stay on I assume we don't want to only be able to provide podman for all new installations… Instead of making this conditional on |
I thought about it but opted not to because:
I could add migrations if we are in agreement that it's the correct solution. |
At least the I agree migrating container root directories in But I'm also not a fan of keeping users upgrading from an older NixOS with state in I'm not sure what's the best approach there, but feel like the first part (new configuration files) should be less problematic and handled first. |
Do I understand correctly that we were using the generic |
Why did those clash in the first place though? Shouldn't new modules use a better named state-directory from the beginning? |
Yes. Both
These locations are often hard-coded and not provided by the NixOS module system. The whole situation is very unfortunate but I don't see a way forward except moving NixOS-containers elsewhere. |
I see. It's fine then :)
Have you checked whether one can migrate NixOS containers to the new location without too much inconveniences? If one has a system with a stateVersion <20.09 and wants to use e.g. |
I agree that using |
537e93d
to
783900c
Compare
@adisbladis News? |
@worldofpeace No news. This is ready for review/merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine to me. Someone more in tune with these components should review it though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First of all thanks a lot for taking care of this! 🎉
I really hope I didn't bring up too much stuff that was discussed in the past. If I forget about this again, please feel free to hit me up on e.g. IRC or Matrix :)
Note to self: before merging I'd like to test a container's migration from /var/lib/containers
to /var/lib/nixos-containers
just to make sure there are no edge-cases to address.
As stated previously, I'd like to see the state-dir being more configurable to make sure that I don't have to bump the state-version of an existing system when I want to migrate my containers to the new location - apart from the other comments I left (/cc @adisbladis). Optionally, I'd add a warning to the documentation about the current state. |
783900c
to
78bbfdc
Compare
I marked this as stale due to inactivity. → More info |
Still matters to me |
I marked this as stale due to inactivity. → More info |
78bbfdc
to
0865c7f
Compare
3add074
to
3dbd6e5
Compare
/etc/containers is also used by Podman, Skopeo & other popular container tooling so we need to be able to move to another configuration directory. The state move is not strictly a requirement but is good for consistency.
We need to move NixOS containers somewhere else so these don't clash with Podman, Skopeo & other container software in the libpod & cri-o/cri-u/libcontainer ecosystems. The state directory move is not strictly a requirement but is good for consistency.
3dbd6e5
to
dc26602
Compare
Years later and this is still relevant.. I have rebased this, moved the release notes to 22.05 & fixed up some breakage. |
I ran all container-related tests, and gave this another look. LGTM, merged! |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/nixos-container-update-flake-fails/20755/4 |
Motivation for this change
We need to move NixOS containers somewhere else so these don't clash with Podman, Skopeo & other container software in the libpod & cri-o/cri-u/libcontainer ecosystems.
The state directory move is not strictly a requirement but is good for consistency.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)Closes #77925