diff options
author | lassulus <lass@aidsballs.de> | 2015-06-14 19:28:57 +0200 |
---|---|---|
committer | lassulus <lass@aidsballs.de> | 2015-06-14 19:28:57 +0200 |
commit | 4846a8e4a8d7c9aeedafa626104a32afaf8d2ab0 (patch) | |
tree | 8b7cd5d2d0a232449c57046bb92846f7e323de6e | |
parent | 3eb5e2ace450035c0cdff424e68eed6906e997e1 (diff) |
deploy: take optional target argument
-rwxr-xr-x | bin/nixos-deploy | 7 | ||||
-rwxr-xr-x | deploy | 6 |
2 files changed, 5 insertions, 8 deletions
diff --git a/bin/nixos-deploy b/bin/nixos-deploy index 6b84186..d33e9a1 100755 --- a/bin/nixos-deploy +++ b/bin/nixos-deploy @@ -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" @@ -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 "$@" |