Loading nixos/modules/config/swap.nix +1 −6 Original line number Diff line number Diff line Loading @@ -203,7 +203,6 @@ in ]; # Create missing swapfiles. # FIXME: support changing the size of existing swapfiles. systemd.services = let Loading @@ -223,11 +222,7 @@ in ${optionalString (sw.size != null) '' currentSize=$(( $(stat -c "%s" "${sw.device}" 2>/dev/null || echo 0) / 1024 / 1024 )) if [ "${toString sw.size}" != "$currentSize" ]; then fallocate -l ${toString sw.size}M "${sw.device}" || dd if=/dev/zero of="${sw.device}" bs=1M count=${toString sw.size} if [ "${toString sw.size}" -lt "$currentSize" ]; then truncate --size "${toString sw.size}M" "${sw.device}" fi chmod 0600 ${sw.device} ${optionalString (!sw.randomEncryption.enable) "mkswap ${sw.realDevice}"} fi Loading Loading
nixos/modules/config/swap.nix +1 −6 Original line number Diff line number Diff line Loading @@ -203,7 +203,6 @@ in ]; # Create missing swapfiles. # FIXME: support changing the size of existing swapfiles. systemd.services = let Loading @@ -223,11 +222,7 @@ in ${optionalString (sw.size != null) '' currentSize=$(( $(stat -c "%s" "${sw.device}" 2>/dev/null || echo 0) / 1024 / 1024 )) if [ "${toString sw.size}" != "$currentSize" ]; then fallocate -l ${toString sw.size}M "${sw.device}" || dd if=/dev/zero of="${sw.device}" bs=1M count=${toString sw.size} if [ "${toString sw.size}" -lt "$currentSize" ]; then truncate --size "${toString sw.size}M" "${sw.device}" fi chmod 0600 ${sw.device} ${optionalString (!sw.randomEncryption.enable) "mkswap ${sw.realDevice}"} fi Loading