-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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: turn vmWithBootLoader into option (nixos-rebuild build-vm
)
#151082
nixos: turn vmWithBootLoader into option (nixos-rebuild build-vm
)
#151082
Conversation
... which is like a specialisation, but for nixos-rebuild build-vm
I think |
We were exposing everything pointwise anyway. If any new attrs are added, there's a good chance we'll want to expose them anyway.
This will help anyone who imports the qemu module themselves, to avoid a collision.
Legacy types.attrs has really bad merging behavior and does not support priorities. f build
bd6ea4b
to
e391690
Compare
e391690
to
a271025
Compare
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.
Looks great now!
Maybe we can add a |
Not a fan of such options, particularly when they're intended to remove things after the fact. The current solution is already more in the spirit of #148456 so I would consider depending on it to be somewhat of a regression. That said, I do think a use case may arise, but I'm not eager to add this option until we know for sure that we need it. |
Thanks for the fast paced collaboration / review! |
OK!
NP! |
Is this ready to get merged? |
I think so. |
I've tested that |
This conflicts with #149532 in some way (tested before/after) and causes the manual to fail to evaluate.
|
Created #155022 but can't merge in the coming ~2h :( g2g |
I greatly appreciate the change and am in favor of its spirit but the fallout needs to be reduced IMO. This broke my VM detection and made my regular configs have VM settings. This could have devastating effects and implications. builtins.hasAttr "vm" config.system.build I'm not sure what other mechanisms there were but I'd prefer they stayed in-tact (with a deprecation notice) and only broke once the new mechanism has reached a stable release. Is that possible? |
Perhaps the attributes could be renamed, so that they don't trigger such logic.
None that I know of and none documented here in the manual at least https://nixos.org/manual/nixos/stable/#sec-changing-config |
I am in favour of renaming the attributes, perhaps to something like |
This is also very non-trivial/near impossible to work around as I finally found a workaround ( |
NixOS/nixpkgs#151082 Should support stable, new unstable and older unstable.
EDIT: Oh I see, I had to add |
I'm running into the same issue as @ElvishJerricco but either I don't understand the proposed solution or it only works within nixpkgs. A related issue #59219 proposes a similar solution but is impure with nixpkgs/nixos/modules/virtualisation/build-vm.nix Lines 8 to 10 in 55c742c
nixos-rebuild build-vm .
I could be misunderstanding as I'm still a nix beginner. My goal is to test my nixosConfigurations locally while tweaking them so I don't need to be near the target machine to see changes to the boot process. |
@jackinloadup I think ElvishJerricco's problem was unrelated to this PR.
If you know of a realistic option that needs to be overridden for |
Motivation for this change
evalModules
calls orvm
definitions.nixos-rebuild build-vm
configuration directly, by setting configs in the new options.vm
andvmWithBootloader
attrs less special. These are now in regular config values.system.build
.This is similar to #144094
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes