Go to file
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 nixpkgs manual: add idris docs generated from *.md 2015-12-21 13:01:59 +01:00
lib ding: init at 1.8 (close #11989) 2015-12-29 21:03:19 +01:00
maintainers copy-tarballs.pl: Create redirects before uploading file 2015-12-16 15:39:08 +01:00
nixos nixos-rebuild: Add option for building and/or deploying on a remote host 2016-01-01 18:21:59 +01:00
pkgs Merge branch 'patch-4' of git://github.com/leenaars/nixpkgs 2016-01-01 09:50:05 -05:00
.gitignore gitignore: pkgs/development/libraries/qt-5/*/tmp/ 2015-02-21 11:39:20 -06:00
.mention-bot .mention-bot: remove illegal comment (close #11488) 2015-12-15 14:46:39 +01:00
.travis.yml travis-ci: use trusty (has 7.5G ram compared to previous 3) 2015-11-02 13:04:03 +01:00
.version .version: remove trailing newline 2015-08-27 00:30:42 +02:00
CONTRIBUTING.md CONTRIBUTING.md: add a notice about licensing 2015-12-19 14:38:00 +01:00
COPYING Update copyright to include contributors 2015-12-18 18:16:54 +01:00
default.nix Expose minimum required Nix version. 2015-11-26 23:11:11 +08:00
README.md README: drop 14.12 references 2015-11-16 08:33:45 +01:00

logo

Build Status Issue Stats Issue Stats

Nixpkgs is a collection of packages for the Nix package manager. It is periodically built and tested by the hydra build daemon as so-called channels. To get channel information via git, add nixpkgs-channels as a remote:

% git remote add channels git://github.com/NixOS/nixpkgs-channels.git

For stability and maximum binary package support, it is recommended to maintain custom changes on top of one of the channels, e.g. nixos-15.09 for the latest release and nixos-unstable for the latest successful build of master:

% git remote update channels
% git rebase channels/nixos-15.09

For pull-requests, please rebase onto nixpkgs master.

NixOS linux distribution source code is located inside nixos/ folder.

Communication: