aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/common.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/common.sh b/tools/common.sh
index a6b41fc..3f99479 100644
--- a/tools/common.sh
+++ b/tools/common.sh
@@ -125,7 +125,8 @@ copy() {
store="$(readlink -f "$(result "$device")")"
local freespace required;
- freespace="$(_ssh "$device" df -B 1 /nix | awk 'NR == 2 { print $4 }')"
+ freespace_raw="$(_ssh "$device" df -B 1 --output=avail /nix)"
+ freespace="$(echo "$freespace_raw" | tail -1)"
required="$(nix path-info -S "$store" | awk '{ print $2 }')"
info "Free space on device: $(numfmt --to=iec "$freespace")"
info "Required space: $(numfmt --to=iec "$required")"