Skip to content

Commit 2f7c1a0

Browse files
committed
apply nix fmt
1 parent 87fd12f commit 2f7c1a0

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/nixos-remote.sh

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ while [[ $# -gt 0 ]]; do
108108
;;
109109

110110
*)
111-
if [[ -z ${ssh_connection:-} ]]; then
111+
if [[ -z ${ssh_connection-} ]]; then
112112
ssh_connection="$1"
113113
else
114114
showUsage
@@ -144,24 +144,24 @@ nix_build() {
144144
"$@"
145145
}
146146

147-
if [[ -z ${ssh_connection:-} ]]; then
147+
if [[ -z ${ssh_connection-} ]]; then
148148
abort "ssh-host must be set"
149149
fi
150150

151151
# parse flake nixos-install style syntax, get the system attr
152-
if [[ -n ${flake:-} ]]; then
152+
if [[ -n ${flake-} ]]; then
153153
if [[ $flake =~ ^(.*)\#([^\#\"]*)$ ]]; then
154154
flake="${BASH_REMATCH[1]}"
155155
flakeAttr="${BASH_REMATCH[2]}"
156156
fi
157-
if [[ -z ${flakeAttr:-} ]]; then
157+
if [[ -z ${flakeAttr-} ]]; then
158158
echo "Please specify the name of the NixOS configuration to be installed, as a URI fragment in the flake-uri."
159159
echo 'For example, to use the output nixosConfigurations.foo from the flake.nix, append "#foo" to the flake-uri.'
160160
exit 1
161161
fi
162162
disko_script=$(nix_build "${flake}#nixosConfigurations.${flakeAttr}.config.system.build.disko")
163163
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
165165
if [[ ! -e ${disko_script} ]] || [[ ! -e ${nixos_system} ]]; then
166166
echo "${disko_script} and ${nixos_system} must be existing store-paths"
167167
exit 1
@@ -196,7 +196,7 @@ SSH
196196
return 1
197197
fi
198198
filtered_facts=$(echo "$facts" | grep -E '^(has|is)_[a-z0-9_]+=\S+')
199-
if [[ -z "$filtered_facts" ]]; then
199+
if [[ -z $filtered_facts ]]; then
200200
abort "Retrieving host facts via ssh failed. Check with --debug for the root cause, unless you have done so already"
201201
fi
202202
# make facts available in script
@@ -209,7 +209,6 @@ until import_facts; do
209209
sleep 5
210210
done
211211

212-
213212
if [[ ${has_tar-n} == "n" ]]; then
214213
abort "no tar command found, but required to unpack kexec tarball"
215214
fi
@@ -272,7 +271,7 @@ if [[ ${stop_after_disko-n} == "y" ]]; then
272271
fi
273272

274273
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
276275
if [[ -d $extra_files ]]; then
277276
extra_files="$extra_files/"
278277
fi

0 commit comments

Comments
 (0)