diff --git a/pkgs/scripts/build.sh b/pkgs/scripts/build.sh index 734e2d9..91bdc13 100644 --- a/pkgs/scripts/build.sh +++ b/pkgs/scripts/build.sh @@ -37,19 +37,19 @@ while [[ $# -gt 0 ]]; do shift done -[[ ! ''${#POSITIONAL_ARGS[@]} -lt 1 ]] || +[[ ! ${#POSITIONAL_ARGS[@]} -lt 1 ]] || die "Missing argument: " -[[ ! ''${#POSITIONAL_ARGS[@]} -gt 1 ]] || +[[ ! ${#POSITIONAL_ARGS[@]} -gt 1 ]] || die "Too many arguments" shopt -s lastpipe -tr , '\n' <<<"''${POSITIONAL_ARGS[0]}" | sort -u | readarray -t HOSTS +tr , '\n' <<<"${POSITIONAL_ARGS[0]}" | sort -u | readarray -t HOSTS NIXOS_CONFIGS=() -for host in "''${HOSTS[@]}"; do +for host in "${HOSTS[@]}"; do NIXOS_CONFIGS+=(".#nixosConfigurations.$host.config.system.build.toplevel") done -echo -e "Building toplevels for \033[0;32m''${#HOSTS[*]} hosts\033[0m" +echo -e "Building toplevels for \033[0;32m${#HOSTS[*]} hosts\033[0m" nom build --print-out-paths --no-link "${OPTIONS[@]}" "${NIXOS_CONFIGS[@]}" || die "Failed building derivations" diff --git a/pkgs/scripts/deploy.sh b/pkgs/scripts/deploy.sh index 23593c9..4aa21b6 100644 --- a/pkgs/scripts/deploy.sh +++ b/pkgs/scripts/deploy.sh @@ -47,15 +47,15 @@ while [[ $# -gt 0 ]]; do shift done -[[ ! ''${#POSITIONAL_ARGS[@]} -lt 1 ]] || +[[ ! ${#POSITIONAL_ARGS[@]} -lt 1 ]] || die "Missing argument: " -[[ ! ''${#POSITIONAL_ARGS[@]} -gt 2 ]] || +[[ ! ${#POSITIONAL_ARGS[@]} -gt 2 ]] || die "Too many arguments" shopt -s lastpipe -tr , '\n' <<<"''${POSITIONAL_ARGS[0]}" | sort -u | readarray -t HOSTS +tr , '\n' <<<"${POSITIONAL_ARGS[0]}" | sort -u | readarray -t HOSTS -ACTION="''${POSITIONAL_ARGS[1]-switch}" +ACTION="${POSITIONAL_ARGS[1]-switch}" function main() { local system @@ -63,8 +63,8 @@ function main() { if [[ $1 == *"@"* ]]; then arr=() echo -n "$1" | readarray -d "@" -t arr - system="''${arr[0]}" - host="root@''${arr[1]}" + system="${arr[0]}" + host="root@${arr[1]}" else system=$1 host=$system @@ -99,9 +99,9 @@ function main() { ) } -echo -e "Building toplevels for \033[0;32m''${#HOSTS[*]} hosts\033[0m" +echo -e "Building toplevels for \033[0;32m${#HOSTS[*]} hosts\033[0m" -for host in "''${HOSTS[@]}"; do +for host in "${HOSTS[@]}"; do main "$host" & done wait