6 .Nd build a network of virtual machines from a network of NixOS configurations
15 .Op Fl -option Ar name value
22 This command builds a network of QEMU\-KVM virtual machines of a Nix expression
23 specifying a network of NixOS machines. The virtual network can be started by
26 shell script that is generated by this command. By default, a
28 symlink is produced that points to the generated virtual network.
31 A network Nix expression has the following structure:
32 .Bd -literal -offset indent
34 test1 = {pkgs, config, ...}:
36 services.openssh.enable = true;
37 nixpkgs.localSystem.system = "i686-linux";
38 deployment.targetHost = "test1.example.net";
43 test2 = {pkgs, config, ...}:
45 services.openssh.enable = true;
46 services.httpd.enable = true;
47 environment.systemPackages = [ pkgs.lynx ];
48 nixpkgs.localSystem.system = "x86_64-linux";
49 deployment.targetHost = "test2.example.net";
57 Each attribute in the expression represents a machine in the network
62 ) referring to a function defining a NixOS configuration. In each NixOS
63 configuration, two attributes have a special meaning. The
64 .Va deployment.targetHost
65 specifies the address (domain name or IP address) of the system which is used by
67 to perform remote deployment operations. The
68 .Va nixpkgs.localSystem.system
69 attribute can be used to specify an architecture for the target machine, such as
71 which builds a 32-bit NixOS configuration. Omitting this property will build the
72 configuration for the same architecture as the host system.
77 .Bl -tag -width indent
79 Shows a trace of the output.
87 Shows the usage of this command to the user.
89 .It Fl -option Ar name Va value
90 Set the Nix configuration option
94 \&. This overrides settings in the Nix configuration file (see
105 .An the Nixpkgs/NixOS contributors