You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

110 lines
3.3 KiB

<refentry xmlns=""
<refmiscinfo class="source">NixOS</refmiscinfo>
<!-- <refmiscinfo class="version"><xi:include href="version.txt" parse="text"/></refmiscinfo> -->
<refpurpose>build a network of virtual machines from a network of NixOS configurations</refpurpose>
<arg choice="plain"><replaceable>network.nix</replaceable></arg>
<para>This 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 <filename>bin/run-vms</filename> shell script that is generated by
this command. By default, a <filename>result</filename> symlink is produced that
points to the generated virtual network.
<para>A network Nix expression has the following structure:
test1 = {pkgs, config, ...}:
services.openssh.enable = true;
nixpkgs.system = "i686-linux";
deployment.targetHost = "";
# Other NixOS options
test2 = {pkgs, config, ...}:
services.openssh.enable = true;
services.httpd.enable = true;
environment.systemPackages = [ pkgs.lynx ];
nixpkgs.system = "x86_64-linux";
deployment.targetHost = "";
# Other NixOS options
Each attribute in the expression represents a machine in the network
(e.g. <varname>test1</varname> and <varname>test2</varname>)
referring to a function defining a NixOS configuration.
In each NixOS configuration, two attributes have a special meaning.
The <varname>deployment.targetHost</varname> specifies the address
(domain name or IP address)
of the system which is used by <command>ssh</command> to perform
remote deployment operations. The <varname>nixpkgs.system</varname>
attribute can be used to specify an architecture for the target machine,
such as <varname>i686-linux</varname> which builds a 32-bit NixOS
configuration. Omitting this property will build the configuration
for the same architecture as the host system.
<para>This command accepts the following options:</para>
<para>Shows a trace of the output.</para>
<para>Do not create a 'result' symlink.</para>
<term><option>-h</option>, <option>--help</option></term>
<para>Shows the usage of this command to the user.</para>