summaryrefslogtreecommitdiffstats
path: root/bin/nixos-deploy
blob: fa86a8c88ac5521d6380bc42d911f0f1d520ab35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#! /bin/sh
#
# nixos-deploy system_name target
#
set -euf

system_name=$1
target=$2

system=$(nixos-build "$system_name")

nix-copy-closure --gzip --to "$target" "$system"

copy-secrets "$system_name" "$target"

ssh ${NIX_SSHOPTS-} "$target" "$system/bin/switch-to-configuration" switch