nixpkgs/nixos
Rickard Nilsson ca0c460406 nixos-rebuild: Add option for building and/or deploying on a remote host
This commit adds the options --build-host and --target-host to nixos-rebuild.

--build-host instructs nixos-rebuild to perform all nix builds on the
specified host (via ssh). Build results are then copied back to the
local machine and used when activating the system.

--build-target instructs nixos-rebuild to activate the configuration
not on the local machine but on the specified remote host. Build
results are copied to the target machine and then activated there (via ssh).

It is possible to combine the usage of --build-host and --target-host,
in which case you can perform the build on one remote machine and deploy
the configuration to another remote machine. The only requirement is that
the build host has a working ssh connection to the target host (if the
target is not local), and that the local machine can connect to both
the target and the build host. Also, your user must be allowed to copy
nix closures between the local machine and the target and host machines.

At no point in time are the configuration sources (the nix files) copied
anywhere. Instead, nix evaluation always happens locally
(with nix-instantiate). The drv-file is then copied and realised remotely
(with nix-store).

As a convenience, if only --target-host is specified, --build-host is
implicitly set to that host too. So if you want to build locally and deploy
remotely you have to explicitly set "--build-host localhost".

To activate (test, boot or switch) you need to have root access to the
target host. You can specify this by "--target-host root@myhost".

I have tested the obvious scenarios and they are working. Some of the
combinations of --build-host and --target-host and the various actions might
not make much sense, and should maybe be forbidden (like setting a remote
target host when building a VM), and some combinations might not work at all.
2016-01-01 18:21:59 +01:00
..
doc/manual release-notes: add pump.io as a new service 2015-12-27 13:32:44 +00:00
lib waitForUnit: Fail if the unit reaches inactive state with no pending jobs 2015-12-30 15:17:52 +01:00
maintainers Hack to parallelize AMI copying 2015-09-29 14:54:12 +02:00
modules nixos-rebuild: Add option for building and/or deploying on a remote host 2016-01-01 18:21:59 +01:00
tests slurm service: add tests 2015-12-25 15:55:07 +01:00
COPYING
default.nix Add a way to pin a NixOS version within the module system. 2015-11-19 20:58:45 +00:00
README
release-combined.nix nixos/tests/networking: Add a test for loopback 2015-12-18 07:09:42 +01:00
release-small.nix release-small.nix: Drop the grub1 test 2015-08-11 13:51:55 +02:00
release.nix amazon-image: enable configure-from-userdata and the corresponding VM test 2015-12-30 04:59:52 +00:00

*** NixOS ***

NixOS is a Linux distribution based on the purely functional package
management system Nix.  More information can be found at
http://nixos.org/nixos and in the manual in doc/manual.