Repository navigation
nixos/nixos-containers: actually eliminate costs if no containers are used - #427001
Conversation
MatthewCroughan
left a comment
There was a problem hiding this comment.
I like this, but maybe there's some hidden impact I'm not considering
09985d2 to
20865f4
Compare
|
This would break the workflow of people using imperative NixOS containers as this module is pulling it into I'm not against changing this default, but it would at least require:
And also be posted to https://discourse.nixos.org/t/breaking-changes-announcement-for-unstable/17574. |
|
It's only the CLI tool that would be affected, right, since we only generate systemd services for declaratively-specified containers anyway? I don't think we should use |
|
This entire snippet feels relevant: networking.dhcpcd.denyInterfaces = [
"ve-*"
"vb-*"
];
services.udev.extraRules = optionalString config.networking.networkmanager.enable ''
# Don't manage interfaces created by nixos-container.
ENV{INTERFACE}=="v[eb]-*", ENV{NM_UNMANAGED}="1"
'';
environment.systemPackages = [
nixos-container
];
boot.kernelModules = [
"bridge"
"macvlan"
"tap"
"tun"
];
Maybe not, but setting the default enable value based on
Good catch! |
As far as I’m aware, you have to explicitly I guess there are two other possibilities:
I feel that avoiding proliferation of (The |
I personally don't care enough to argue about it, but I've seen NixOS deployments using declarative NixOS base systems with imperative containers deployed on top so I know just changing the default value would at least break a channel bump for a few users out there.
I don't see how |
There was a problem hiding this comment.
When the default evaluates to something using config, you need to include a defaultText.
also the description needs an update, since it no longer defaults to true and it's not zero cost if it's set to true anyway.
That would be covered by the assertion I mentioned, right? Unless I’m being insufficiently creative imagining how people are automatically starting imperatively‐defined containers from their declarative configurations :) |
The workflow I'm describing is a script that does something like:
|
20865f4 to
b926f95
Compare
|
@emilazy i just added the assertion you mentioned, but i feel like its a bit heavy to eval for an assertion. (keeping it in a separate commit for now in case changes are requested) One edgecase this has is if someone defines their own service to handle |
e726799 to
444c938
Compare
There was a problem hiding this comment.
Whoops, sorry, I typo’d the option name here. Let’s use the link form since that would have caught this:
| - `boot.enableContainers` is only turned on when a NixOS container is defined in `boot.containers`. | |
| - [](#opt-boot.enableContainers) is only turned on when a declarative NixOS container is defined in [](#opt-containers). |
There was a problem hiding this comment.
seems like we can't link to those options as they not part of the release notes
a938da3 to
b2ec1c8
Compare
b2ec1c8 to
29be71c
Compare
emilazy
left a comment
There was a problem hiding this comment.
Huh, I could swear we have other release notes linking to the options. But this is fine, thank you!
Could you make a post in the breaking changes announcement thread to let unstable users know they need to turn on boot.enableContainers if they use the nixos-container tool for imperative container management?
|
Ah, and right as I hit merge I realize the NixOS tests will need adjusting… |
- Fixed dwm alpha patch for dwm 6.6 - Fixed breaking change with declarative containers used imperatively NixOS/nixpkgs#427001 - Fixed obsolete options
currently the man page reads like this:
but the
nixos-containerpackage still gets added to the packages if they are actually not used, adding at least 64MiB of space used when one tries to not have perl in the system closure.Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.