Hello, I hope you're all doing well, and that its okay that I ask a question regarding nixos.
https://github.com/NixOS/nixpkgs/blob/nixos-24.11/nixos/lib/testing/driver.nix#L18
vms = map (m: m.system.build.vm) (lib.attrValues config.nodes);
https://github.com/NixOS/nixpkgs/blob/nixos-24.11/nixos/modules/virtualisation/build-vm.nix
system.build.vm = lib.mkDefault config.virtualisation.vmVariant.system.build.vm;
https://github.com/NixOS/nixpkgs/blob/nixos-24.11/nixos/modules/virtualisation/qemu-vm.nix#L1332-L1342
system.build.vm = hostPkgs.runCommand "nixos-vm" ...
can anyone help me understand why when i use runTest /evalTest , and it uses system.build.vm , without applying the extendModules [in build-vm.nix], but when i use nixpkgs.lib.nixosSystem , it does apply extendModules [in build-vm.nix]
testers.runNixOSTest {
name = "boot-${k}";
node.pkgsReadOnly = false;
nodes.machine.imports = v.modules ++ [
{ virtualisation.vmVariant.services.openssh.enable = lib.mkForce true; }
];
node.specialArgs = prelude.mkSpecialArgs v;
testScript =
''
machine.start()
machine.wait_for_unit("default.target")
machine.wait_for_unit("sshd.service")
'';
})
My objective goal, (which may be silly, i'm happy for input aswell), is that this should include openssh as part of the test env but not the production env.
Thank you for your time.
|