diff --git a/modules/tasks/swap.nix b/modules/tasks/swap.nix index 333cf674c077..ab81185532ea 100644 --- a/modules/tasks/swap.nix +++ b/modules/tasks/swap.nix @@ -94,7 +94,7 @@ in device=$(readlink -f "$device") # Add new swap devices. if echo $unused | grep -q "^$device\$"; then - unused="$(echo $unused | grep -v "^$device\$")" + unused="$(echo $unused | grep -v "^$device\$" || true)" else ${utillinux}/sbin/swapon "$device" || true fi