-
-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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/nixos-containers: inherit {base,extra}Modules #349163
nixos/nixos-containers: inherit {base,extra}Modules #349163
Conversation
I'm pretty sure it's supposed to be a completely independent NixOS, also considering a completely different version can be loaded with the I imagine this would be useful for testing "what if I'd already upstreamed my module", so perhaps it could be an explicit opt-in? Something like |
Well, Put another way, I observe that it is a recurrent need for me, and I'm not doing anything special, to inject generic/host-agnostic modules into |
Ok, if I'm being naive I should say let's just propagate |
I meant host configuration to be anything that affects As a NixOS user I can pass a different set of Do you really want to make NixOS containers decidedly less reproducible? This affects the "image" part of the container after all; not just runtime stuff.
The same reasoning applies. You are free to add similar wiring by hand, and it would also be ok to make it easier by adding a flag like I proposed to propagate those modules automatically, but it must be opt-in and per container. |
I don't see how they're getting any less reproducible; baseModules and extraModules are an input to the containers just like to normal nixosConfigurations: you pin them and they're reproducible. The difference is, when you manage in one place a collection of N containers and they share some declarations, do you repeat
Ah yes sure, the |
Preferably the first. That way it's clear what goes into the container. I guess the word I was looking for was portability; being able to reproduce it as part of a different system, which in this case is merely a different host. If it's explicitly imported, it's easy to move the container to different host (with different |
Opening a draft, I was wondering if the proposed behaviour would read as surprising, unintuitive or wrong to someone previously familiar with the module. That is now clear enough. The old behaviour should not be changed under the same name. At the most, a new behaviour under a new name may be considered. The documentation for the old behaviour is to be updated: that both I'm still uncertain as to the purpose of
Having slept on it, I maybe see better where you're coming from and am reconsidering my motivations. The lens I've been looking through, the use-case, is that the artifact to be kept portable is not a set of individual containers, but the collection of containers as a whole. The entrypoint would produce the collection, not a single container. The individual containers might move between machines defined in a single monorepo, which all share the same "extra modules". The machines and containers might be populated using something like |
Hey, thanks for opening this PR, and I'm glad we aligned on this.
|
I've opened a PR to eventually remove the environment variable, but the use case "pretend NixOS has an extra/different module" also comes up in the test framework (implemented with |
No idea if this generally makes sense, but I've tried something of the sort with
microvm.nix
and it didn't seem to fall apart.I'd expect the change to be "breaking".
CC @roberth
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.