2010-12-07 16:33:18 +00:00
|
|
|
<refentry xmlns="http://docbook.org/ns/docbook"
|
|
|
|
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
|
|
xmlns:xi="http://www.w3.org/2001/XInclude">
|
2018-05-01 23:57:09 +00:00
|
|
|
<refmeta>
|
|
|
|
<refentrytitle><command>nixos-build-vms</command>
|
|
|
|
</refentrytitle><manvolnum>8</manvolnum>
|
2010-12-07 16:33:18 +00:00
|
|
|
<refmiscinfo class="source">NixOS</refmiscinfo>
|
2018-05-01 23:57:09 +00:00
|
|
|
<!-- <refmiscinfo class="version"><xi:include href="version.txt" parse="text"/></refmiscinfo> -->
|
|
|
|
</refmeta>
|
|
|
|
<refnamediv>
|
|
|
|
<refname><command>nixos-build-vms</command>
|
|
|
|
</refname><refpurpose>build a network of virtual machines from a network of NixOS configurations</refpurpose>
|
|
|
|
</refnamediv>
|
|
|
|
<refsynopsisdiv>
|
|
|
|
<cmdsynopsis><command>nixos-build-vms</command>
|
|
|
|
<arg><option>--show-trace</option>
|
|
|
|
</arg>
|
|
|
|
<arg><option>--no-out-link</option>
|
|
|
|
</arg>
|
|
|
|
<arg><option>--help</option>
|
|
|
|
</arg>
|
|
|
|
<arg choice="plain"><replaceable>network.nix</replaceable>
|
|
|
|
</arg>
|
2010-12-07 16:33:18 +00:00
|
|
|
</cmdsynopsis>
|
2018-05-01 23:57:09 +00:00
|
|
|
</refsynopsisdiv>
|
|
|
|
<refsection>
|
|
|
|
<title>Description</title>
|
|
|
|
<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>
|
|
|
|
<para>
|
|
|
|
A network Nix expression has the following structure:
|
2010-12-07 16:33:18 +00:00
|
|
|
<screen>
|
|
|
|
{
|
|
|
|
test1 = {pkgs, config, ...}:
|
|
|
|
{
|
|
|
|
services.openssh.enable = true;
|
2018-04-05 19:22:45 +00:00
|
|
|
nixpkgs.localSystem.system = "i686-linux";
|
2010-12-07 20:13:50 +00:00
|
|
|
deployment.targetHost = "test1.example.net";
|
2016-06-01 14:23:32 +00:00
|
|
|
|
2010-12-07 16:33:18 +00:00
|
|
|
# Other NixOS options
|
|
|
|
};
|
2016-06-01 14:23:32 +00:00
|
|
|
|
2010-12-07 16:33:18 +00:00
|
|
|
test2 = {pkgs, config, ...}:
|
|
|
|
{
|
|
|
|
services.openssh.enable = true;
|
|
|
|
services.httpd.enable = true;
|
|
|
|
environment.systemPackages = [ pkgs.lynx ];
|
2018-04-05 19:22:45 +00:00
|
|
|
nixpkgs.localSystem.system = "x86_64-linux";
|
2010-12-07 20:13:50 +00:00
|
|
|
deployment.targetHost = "test2.example.net";
|
2016-06-01 14:23:32 +00:00
|
|
|
|
2010-12-07 16:33:18 +00:00
|
|
|
# Other NixOS options
|
|
|
|
};
|
|
|
|
}
|
|
|
|
</screen>
|
2018-05-01 23:57:09 +00:00
|
|
|
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.localSystem.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>
|
|
|
|
</refsection>
|
|
|
|
<refsection>
|
|
|
|
<title>Options</title>
|
|
|
|
<para>
|
|
|
|
This command accepts the following options:
|
|
|
|
</para>
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><option>--show-trace</option>
|
|
|
|
</term>
|
2010-12-07 16:33:18 +00:00
|
|
|
<listitem>
|
2018-05-01 23:57:09 +00:00
|
|
|
<para>
|
|
|
|
Shows a trace of the output.
|
|
|
|
</para>
|
2010-12-07 16:33:18 +00:00
|
|
|
</listitem>
|
2018-05-01 23:57:09 +00:00
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><option>--no-out-link</option>
|
|
|
|
</term>
|
2010-12-07 16:33:18 +00:00
|
|
|
<listitem>
|
2018-05-01 23:57:09 +00:00
|
|
|
<para>
|
|
|
|
Do not create a 'result' symlink.
|
|
|
|
</para>
|
2010-12-07 16:33:18 +00:00
|
|
|
</listitem>
|
2018-05-01 23:57:09 +00:00
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><option>-h</option>, <option>--help</option>
|
|
|
|
</term>
|
2010-12-07 16:33:18 +00:00
|
|
|
<listitem>
|
2018-05-01 23:57:09 +00:00
|
|
|
<para>
|
|
|
|
Shows the usage of this command to the user.
|
|
|
|
</para>
|
2010-12-07 16:33:18 +00:00
|
|
|
</listitem>
|
2018-05-01 23:57:09 +00:00
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</refsection>
|
2010-12-07 16:33:18 +00:00
|
|
|
</refentry>
|