summaryrefslogtreecommitdiffstats
path: root/bin/nixos-deploy
blob: d33e9a1d9068cab3be3ba39bd98680164d15d9bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#! /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