Strip user and domain name
This commit is contained in:
parent
3ed7b4e16f
commit
d2746303b2
|
@ -26,7 +26,10 @@ while [[ $# -gt 0 ]]; do
|
|||
build_local=true
|
||||
;;
|
||||
*)
|
||||
target=$1
|
||||
# strip hostname and user
|
||||
host=$1
|
||||
target=${1//.hq.c3d2.de/}
|
||||
target=${target//.c3d2.de/}
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
|
@ -35,8 +38,8 @@ done
|
|||
if [[ -v build_local ]]; then
|
||||
nix --experimental-features 'nix-command flakes' -Lv build ".#nixosConfigurations.$target.config.system.build.toplevel"
|
||||
store_path=$(readlink -f result)
|
||||
nix-copy-closure --to root@"$target" -v "$store_path"
|
||||
ssh root@"$target" "$store_path/bin/switch-to-configuration" switch
|
||||
nix-copy-closure --to root@"$host" -v "$store_path"
|
||||
ssh root@"$host" "$store_path/bin/switch-to-configuration" switch
|
||||
else
|
||||
hostname=$(echo "$target" | cut -d . -f 1)
|
||||
|
||||
|
|
Loading…
Reference in New Issue