deploy: take optional target argument

This commit is contained in:
lassulus 2015-06-14 19:28:57 +02:00
parent afa7f0b98d
commit fac851faf9
2 changed files with 5 additions and 8 deletions

View File

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

6
deploy
View File

@ -1,11 +1,9 @@
#! /bin/sh
#
# usage: ./deploy HOST
# usage: ./deploy HOST [TARGET]
#
set -euf
host=$1
export PATH="$PWD/bin:$PATH"
#export nixpkgs=/var/nixpkgs
export nixpkgs_root=$PWD/tmp/nixpkgs
@ -13,4 +11,4 @@ export config_root=$PWD
export retiolum_hosts=$PWD/hosts
export secrets_root=$PWD/secrets
exec nixos-deploy "$host"
exec nixos-deploy "$@"