nixos-build-vms8NixOSnixos-build-vmsbuild a network of virtual machines from a network of NixOS configurationsnixos-build-vmsnetwork.nixDescriptionThis command builds a network of QEMU-KVM virtual machines of a Nix expression
specifying a network of NixOS machines. The virtual network can be started by
executing the bin/run-vms shell script that is generated by
this command. By default, a result symlink is produced that
points to the generated virtual network.
A network Nix expression has the following structure:
{
test1 = {pkgs, config, ...}:
{
services.openssh.enable = true;
nixpkgs.localSystem.system = "i686-linux";
deployment.targetHost = "test1.example.net";
# Other NixOS options
};
test2 = {pkgs, config, ...}:
{
services.openssh.enable = true;
services.httpd.enable = true;
environment.systemPackages = [ pkgs.lynx ];
nixpkgs.localSystem.system = "x86_64-linux";
deployment.targetHost = "test2.example.net";
# Other NixOS options
};
}
Each attribute in the expression represents a machine in the network
(e.g. test1 and test2)
referring to a function defining a NixOS configuration.
In each NixOS configuration, two attributes have a special meaning.
The deployment.targetHost specifies the address
(domain name or IP address)
of the system which is used by ssh to perform
remote deployment operations. The nixpkgs.localSystem.system
attribute can be used to specify an architecture for the target machine,
such as i686-linux which builds a 32-bit NixOS
configuration. Omitting this property will build the configuration
for the same architecture as the host system.
OptionsThis command accepts the following options:Shows a trace of the output.Do not create a 'result' symlink., Shows the usage of this command to the user.