2015-05-21 22:33:16 +02:00
|
|
|
#! /bin/sh
|
|
|
|
#
|
2015-06-14 19:28:57 +02:00
|
|
|
# usage: nixos-deploy HOST [TARGET] [SYSTEM]
|
2015-05-21 22:33:16 +02:00
|
|
|
#
|
|
|
|
set -euf
|
|
|
|
|
|
|
|
host=$1
|
2015-06-14 19:28:57 +02:00
|
|
|
target=${2-root@$host}
|
|
|
|
system=${3-$(nixos-build "$host")}
|
2015-05-21 22:33:16 +02:00
|
|
|
|
|
|
|
nix-copy-closure --gzip --to "$target" "$system"
|
|
|
|
|
|
|
|
copy-secrets "$host"
|
|
|
|
|
|
|
|
ssh ${NIX_SSHOPTS-} "$target" "$system/bin/switch-to-configuration" switch
|