stockholm/bin/nixos-deploy
2015-06-14 19:28:57 +02:00

16 lines
284 B
Bash
Executable File

#! /bin/sh
#
# usage: nixos-deploy HOST [TARGET] [SYSTEM]
#
set -euf
host=$1
target=${2-root@$host}
system=${3-$(nixos-build "$host")}
nix-copy-closure --gzip --to "$target" "$system"
copy-secrets "$host"
ssh ${NIX_SSHOPTS-} "$target" "$system/bin/switch-to-configuration" switch