nixos/swap: add progress to swapfile creation

This commit is contained in:
Wulfsta 2024-07-16 19:54:51 -04:00
parent eaa59831a1
commit f2f8f302fd

View File

@ -272,7 +272,8 @@ in
truncate --size 0 "$DEVICE"
chattr +C "$DEVICE" 2>/dev/null || true
dd if=/dev/zero of="$DEVICE" bs=1M count=${toString sw.size}
echo "Creating swap file using dd and mkswap."
dd if=/dev/zero of="$DEVICE" bs=1M count=${toString sw.size} status=progress
${lib.optionalString (!sw.randomEncryption.enable) "mkswap ${sw.realDevice}"}
fi
''}