@@ -108,7 +108,7 @@ while [[ $# -gt 0 ]]; do
108
108
;;
109
109
110
110
* )
111
- if [[ -z ${ssh_connection: - } ]]; then
111
+ if [[ -z ${ssh_connection-} ]]; then
112
112
ssh_connection=" $1 "
113
113
else
114
114
showUsage
@@ -144,24 +144,24 @@ nix_build() {
144
144
" $@ "
145
145
}
146
146
147
- if [[ -z ${ssh_connection: - } ]]; then
147
+ if [[ -z ${ssh_connection-} ]]; then
148
148
abort " ssh-host must be set"
149
149
fi
150
150
151
151
# parse flake nixos-install style syntax, get the system attr
152
- if [[ -n ${flake: - } ]]; then
152
+ if [[ -n ${flake-} ]]; then
153
153
if [[ $flake =~ ^(.* )\# ([^\#\" ]* )$ ]]; then
154
154
flake=" ${BASH_REMATCH[1]} "
155
155
flakeAttr=" ${BASH_REMATCH[2]} "
156
156
fi
157
- if [[ -z ${flakeAttr: - } ]]; then
157
+ if [[ -z ${flakeAttr-} ]]; then
158
158
echo " Please specify the name of the NixOS configuration to be installed, as a URI fragment in the flake-uri."
159
159
echo ' For example, to use the output nixosConfigurations.foo from the flake.nix, append "#foo" to the flake-uri.'
160
160
exit 1
161
161
fi
162
162
disko_script=$( nix_build " ${flake} #nixosConfigurations.${flakeAttr} .config.system.build.disko" )
163
163
nixos_system=$( nix_build " ${flake} #nixosConfigurations.${flakeAttr} .config.system.build.toplevel" )
164
- elif [[ -n ${disko_script: - } ]] && [[ -n ${nixos_system: - } ]]; then
164
+ elif [[ -n ${disko_script-} ]] && [[ -n ${nixos_system-} ]]; then
165
165
if [[ ! -e ${disko_script} ]] || [[ ! -e ${nixos_system} ]]; then
166
166
echo " ${disko_script} and ${nixos_system} must be existing store-paths"
167
167
exit 1
196
196
return 1
197
197
fi
198
198
filtered_facts=$( echo " $facts " | grep -E ' ^(has|is)_[a-z0-9_]+=\S+' )
199
- if [[ -z " $filtered_facts " ]]; then
199
+ if [[ -z $filtered_facts ]]; then
200
200
abort " Retrieving host facts via ssh failed. Check with --debug for the root cause, unless you have done so already"
201
201
fi
202
202
# make facts available in script
@@ -209,7 +209,6 @@ until import_facts; do
209
209
sleep 5
210
210
done
211
211
212
-
213
212
if [[ ${has_tar-n} == " n" ]]; then
214
213
abort " no tar command found, but required to unpack kexec tarball"
215
214
fi
@@ -272,7 +271,7 @@ if [[ ${stop_after_disko-n} == "y" ]]; then
272
271
fi
273
272
274
273
nix_copy --to " ssh://$ssh_connection ?remote-store=local?root=/mnt" " $nixos_system "
275
- if [[ -n ${extra_files: - } ]]; then
274
+ if [[ -n ${extra_files-} ]]; then
276
275
if [[ -d $extra_files ]]; then
277
276
extra_files=" $extra_files /"
278
277
fi
0 commit comments