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
|
build_local=true
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
target=$1
|
# strip hostname and user
|
||||||
|
host=$1
|
||||||
|
target=${1//.hq.c3d2.de/}
|
||||||
|
target=${target//.c3d2.de/}
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
|
@ -35,8 +38,8 @@ done
|
||||||
if [[ -v build_local ]]; then
|
if [[ -v build_local ]]; then
|
||||||
nix --experimental-features 'nix-command flakes' -Lv build ".#nixosConfigurations.$target.config.system.build.toplevel"
|
nix --experimental-features 'nix-command flakes' -Lv build ".#nixosConfigurations.$target.config.system.build.toplevel"
|
||||||
store_path=$(readlink -f result)
|
store_path=$(readlink -f result)
|
||||||
nix-copy-closure --to root@"$target" -v "$store_path"
|
nix-copy-closure --to root@"$host" -v "$store_path"
|
||||||
ssh root@"$target" "$store_path/bin/switch-to-configuration" switch
|
ssh root@"$host" "$store_path/bin/switch-to-configuration" switch
|
||||||
else
|
else
|
||||||
hostname=$(echo "$target" | cut -d . -f 1)
|
hostname=$(echo "$target" | cut -d . -f 1)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue