Swap: Difference between revisions

Hasnep (talk | contribs)
m Fix typo in URL
Hasnep (talk | contribs)
m Change GB to GiB and MB to MiB
 
Line 23: Line 23:
swapDevices = [{
swapDevices = [{
   device = "/var/lib/swapfile";
   device = "/var/lib/swapfile";
   size = 16*1024; # 16 GB
   size = 16*1024; # 16 GiB
}];
}];
</nowiki>
</nowiki>
}}
}}


This will create a 16GB swapfile at <code>/var/lib/swapfile</code>. The <code>size</code> value [https://search.nixos.org/options?show=swapDevices.*.size is specified in megabytes]. This will cause a swap file to be generated and an entry to be set up in <code>/etc/fstab</code>.
This will create a 16GB swapfile at <code>/var/lib/swapfile</code>. The <code>size</code> value [https://search.nixos.org/options?show=swapDevices.*.size is specified in mebibytes]. This will cause a swap file to be generated and an entry to be set up in <code>/etc/fstab</code>.


== Swap partition ==
== Swap partition ==