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.

man-nixos-build-vms.xml 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <refentry xmlns="http://docbook.org/ns/docbook"
  2. xmlns:xlink="http://www.w3.org/1999/xlink"
  3. xmlns:xi="http://www.w3.org/2001/XInclude">
  4. <refmeta>
  5. <refentrytitle><command>nixos-build-vms</command>
  6. </refentrytitle><manvolnum>8</manvolnum>
  7. <refmiscinfo class="source">NixOS</refmiscinfo>
  8. <!-- <refmiscinfo class="version"><xi:include href="version.txt" parse="text"/></refmiscinfo> -->
  9. </refmeta>
  10. <refnamediv>
  11. <refname><command>nixos-build-vms</command></refname>
  12. <refpurpose>build a network of virtual machines from a network of NixOS configurations</refpurpose>
  13. </refnamediv>
  14. <refsynopsisdiv>
  15. <cmdsynopsis>
  16. <command>nixos-build-vms</command>
  17. <arg>
  18. <option>--show-trace</option>
  19. </arg>
  20. <arg>
  21. <option>--no-out-link</option>
  22. </arg>
  23. <arg>
  24. <option>--help</option>
  25. </arg>
  26. <arg>
  27. <option>--option</option>
  28. <replaceable>name</replaceable>
  29. <replaceable>value</replaceable>
  30. </arg>
  31. <arg choice="plain">
  32. <replaceable>network.nix</replaceable>
  33. </arg>
  34. </cmdsynopsis>
  35. </refsynopsisdiv>
  36. <refsection>
  37. <title>Description</title>
  38. <para>
  39. This command builds a network of QEMU-KVM virtual machines of a Nix
  40. expression specifying a network of NixOS machines. The virtual network can
  41. be started by executing the <filename>bin/run-vms</filename> shell script
  42. that is generated by this command. By default, a <filename>result</filename>
  43. symlink is produced that points to the generated virtual network.
  44. </para>
  45. <para>
  46. A network Nix expression has the following structure:
  47. <screen>
  48. {
  49. test1 = {pkgs, config, ...}:
  50. {
  51. services.openssh.enable = true;
  52. nixpkgs.localSystem.system = "i686-linux";
  53. deployment.targetHost = "test1.example.net";
  54. # Other NixOS options
  55. };
  56. test2 = {pkgs, config, ...}:
  57. {
  58. services.openssh.enable = true;
  59. services.httpd.enable = true;
  60. environment.systemPackages = [ pkgs.lynx ];
  61. nixpkgs.localSystem.system = "x86_64-linux";
  62. deployment.targetHost = "test2.example.net";
  63. # Other NixOS options
  64. };
  65. }
  66. </screen>
  67. Each attribute in the expression represents a machine in the network (e.g.
  68. <varname>test1</varname> and <varname>test2</varname>) referring to a
  69. function defining a NixOS configuration. In each NixOS configuration, two
  70. attributes have a special meaning. The
  71. <varname>deployment.targetHost</varname> specifies the address (domain name
  72. or IP address) of the system which is used by <command>ssh</command> to
  73. perform remote deployment operations. The
  74. <varname>nixpkgs.localSystem.system</varname> attribute can be used to
  75. specify an architecture for the target machine, such as
  76. <varname>i686-linux</varname> which builds a 32-bit NixOS configuration.
  77. Omitting this property will build the configuration for the same
  78. architecture as the host system.
  79. </para>
  80. </refsection>
  81. <refsection>
  82. <title>Options</title>
  83. <para>
  84. This command accepts the following options:
  85. </para>
  86. <variablelist>
  87. <varlistentry>
  88. <term>
  89. <option>--show-trace</option>
  90. </term>
  91. <listitem>
  92. <para>
  93. Shows a trace of the output.
  94. </para>
  95. </listitem>
  96. </varlistentry>
  97. <varlistentry>
  98. <term>
  99. <option>--no-out-link</option>
  100. </term>
  101. <listitem>
  102. <para>
  103. Do not create a 'result' symlink.
  104. </para>
  105. </listitem>
  106. </varlistentry>
  107. <varlistentry>
  108. <term>
  109. <option>-h</option>, <option>--help</option>
  110. </term>
  111. <listitem>
  112. <para>
  113. Shows the usage of this command to the user.
  114. </para>
  115. </listitem>
  116. </varlistentry>
  117. <varlistentry>
  118. <term>
  119. <option>--option</option> <replaceable>name</replaceable> <replaceable>value</replaceable>
  120. </term>
  121. <listitem>
  122. <para>Set the Nix configuration option
  123. <replaceable>name</replaceable> to <replaceable>value</replaceable>.
  124. This overrides settings in the Nix configuration file (see
  125. <citerefentry><refentrytitle>nix.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>).
  126. </para>
  127. </listitem>
  128. </varlistentry>
  129. </variablelist>
  130. </refsection>
  131. </refentry>