at 24.11-pre 2.4 kB view raw
1.Dd January 1, 1980 2.Dt nixos-build-vms 8 3.Os 4.Sh NAME 5.Nm nixos-build-vms 6.Nd build a network of virtual machines from a network of NixOS configurations 7. 8. 9. 10.Sh SYNOPSIS 11.Nm nixos-build-vms 12.Op Fl -show-trace 13.Op Fl -no-out-link 14.Op Fl -help 15.Op Fl -option Ar name value 16.Pa network.nix 17. 18. 19. 20.Sh DESCRIPTION 21. 22This command builds a network of QEMU\-KVM virtual machines of a Nix expression 23specifying a network of NixOS machines. The virtual network can be started by 24executing the 25.Pa bin/run-vms 26shell script that is generated by this command. By default, a 27.Pa result 28symlink is produced that points to the generated virtual network. 29. 30.Pp 31A network Nix expression has the following structure: 32.Bd -literal -offset indent 33{ 34 test1 = {pkgs, config, ...}: 35 { 36 services.openssh.enable = true; 37 nixpkgs.localSystem.system = "i686-linux"; 38 deployment.targetHost = "test1.example.net"; 39 40 # Other NixOS options 41 }; 42 43 test2 = {pkgs, config, ...}: 44 { 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"; 50 51 # Other NixOS options 52 }; 53} 54.Ed 55. 56.Pp 57Each attribute in the expression represents a machine in the network 58.Ns (e.g. 59.Va test1 60and 61.Va test2 Ns 62) referring to a function defining a NixOS configuration. In each NixOS 63configuration, two attributes have a special meaning. The 64.Va deployment.targetHost 65specifies the address (domain name or IP address) of the system which is used by 66.Ic ssh 67to perform remote deployment operations. The 68.Va nixpkgs.localSystem.system 69attribute can be used to specify an architecture for the target machine, such as 70.Ql i686-linux 71which builds a 32-bit NixOS configuration. Omitting this property will build the 72configuration for the same architecture as the host system. 73. 74. 75. 76.Sh OPTIONS 77.Bl -tag -width indent 78.It Fl -show-trace 79Shows a trace of the output. 80. 81.It Fl -no-out-link 82Do not create a 83.Pa result 84symlink. 85. 86.It Fl h , -help 87Shows the usage of this command to the user. 88. 89.It Fl -option Ar name Va value 90Set the Nix configuration option 91.Va name 92to 93.Va value Ns 94\&. This overrides settings in the Nix configuration file (see 95.Xr nix.conf 5 Ns 96). 97.El 98. 99. 100. 101.Sh AUTHORS 102.An -nosplit 103.An Eelco Dolstra 104and 105.An the Nixpkgs/NixOS contributors