diff --git a/doc/manual/man-nixos-build-vms.xml b/doc/manual/man-nixos-build-vms.xml new file mode 100644 index 00000000000..3bbf9defb11 --- /dev/null +++ b/doc/manual/man-nixos-build-vms.xml @@ -0,0 +1,147 @@ + + + + nixos-build-vms + 8 + NixOS + + + + + nixos-build-vms + build a network of virtual machines from a network of NixOS configurations + + + + + nixos-deploy-network + + + + + network.nix + + + +Description + +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 bin/run-vms shell script that is generated by +this command. By default, a result symlink is produced that +points to the generated virtual network. + + +This command also provides the option, +which spawns UNIX domain sockets in the current working directory by using the +socat command. This allows +users to remotely script a generated virtual machine. + +A network Nix expression has the following structure: + + +{ + test1 = {pkgs, config, ...}: + { + services.openssh.enable = true; + nixpkgs.system = "i686-linux"; + deployment.hostname = "test1.example.net"; + + # Other NixOS options + }; + + test2 = {pkgs, config, ...}: + { + services.openssh.enable = true; + services.httpd.enable = true; + environment.systemPackages = [ pkgs.lynx ]; + nixpkgs.system = "x86_64-linux"; + deployment.hostname = "test2.example.net"; + + # Other NixOS options + }; +} + + +Each attribute in the expression represents a machine in the network +(e.g. test1 and test2) +referring to a function defining a NixOS configuration. +In each NixOS configuration, two attributes have a special meaning. +The deployment.hostname specifies the hostname +of the system which is used by ssh to perform +remote deployment operations. The nixpkgs.system +attribute can be used to specify an architecture for the target machine, +such as i686-linux which builds a 32-bit NixOS +configuration. Omitting this property will build the configuration +for the same architecture as the host system. + + + + +Options + +This command accepts the following options: + + + + + + + Indicates that the backdoor must be enabled so that the VMs can be + accessed through a UNIX domain socket. The UNIX domain sockets are + created in the current working directory. + + + + + + + Shows a trace of the output. + + + + + + + Do not create a 'result' symlink. + + + + + , + + Shows the usage of this command to the user. + + + + + + + + +Environment variables + + + + + NIXOS + + Path to the NixOS source tree. Defaults to + /etc/nixos/nixos. + + + + + NIXPKGS_ALL + + Path to the Nixpkgs source tree. Defaults to + /etc/nixos/nixpkgs. + + + + + + + diff --git a/doc/manual/man-nixos-deploy-network.xml b/doc/manual/man-nixos-deploy-network.xml new file mode 100644 index 00000000000..0a84ebefeea --- /dev/null +++ b/doc/manual/man-nixos-deploy-network.xml @@ -0,0 +1,134 @@ + + + + nixos-deploy-network + 8 + NixOS + + + + + nixos-deploy-network + deploy a network of NixOS configurations into a network of machines + + + + + nixos-deploy-network + + + + network.nix + + + +Description + +This command automatically deploys a network of NixOS +configurations into a network of machines. +First, it tries to build all the system derivations defined +in the network expression. Then it efficiently transfers +the closures to the machines in the network. Finally, the configurations +are activated. In case of a failure, a rollback is performed, +which brings all the updated configurations back into the previous +state. + +A network Nix expression has the following structure: + + +{ + test1 = {pkgs, config, ...}: + { + services.openssh.enable = true; + nixpkgs.system = "i686-linux"; + deployment.hostname = "test1.example.net"; + + # Other NixOS options + }; + + test2 = {pkgs, config, ...}: + { + services.openssh.enable = true; + services.httpd.enable = true; + environment.systemPackages = [ pkgs.lynx ]; + nixpkgs.system = "x86_64-linux"; + deployment.hostname = "test2.example.net"; + + # Other NixOS options + }; +} + + +Each attribute in the expression represents a machine in the network +(e.g. test1 and test2) +referring to a function defining a NixOS configuration. +In each NixOS configuration, two attributes have a special meaning. +The deployment.hostname specifies the hostname +of the system which is used by ssh to perform +remote deployment operations. The nixpkgs.system +attribute can be used to specify an architecture for the target machine, +such as i686-linux which builds a 32-bit NixOS +configuration. Omitting this property will build the configuration +for the same architecture as the host system. + + + + +Options + +This command accepts the following options: + + + + + + + Shows a trace of the output. + + + + + + + Do not create a 'result' symlink. + + + + + , + + Shows the usage of this command to the user. + + + + + + + + +Environment variables + + + + + NIXOS + + Path to the NixOS source tree. Defaults to + /etc/nixos/nixos. + + + + + NIXPKGS_ALL + + Path to the Nixpkgs source tree. Defaults to + /etc/nixos/nixpkgs. + + + + + + + diff --git a/doc/manual/man-pages.xml b/doc/manual/man-pages.xml index e3b3a5bc289..ffe0100c5ed 100644 --- a/doc/manual/man-pages.xml +++ b/doc/manual/man-pages.xml @@ -26,5 +26,6 @@ - + +