Swap: Difference between revisions
imported>Yuu No edit summary |
imported>Axelbdt Add method to add swapfile |
||
| Line 1: | Line 1: | ||
== Configuration == | == Configuration == | ||
Swap on NixOS is set with the option <code>swapDevices</code> on <code>/etc/nixos/hardware-configuration.nix</code>. | Swap on NixOS is set with the option <code>swapDevices</code> on <code>/etc/nixos/hardware-configuration.nix</code>. | ||
=== Add a Swapfile === | |||
Add a swapfile with the following : | |||
<syntaxhighlight lang="nix"> | |||
swapDevices = [ { | |||
device = "/var/lib/swapfile"; | |||
size = 16*1024; | |||
} ]; | |||
</syntaxhighlight> | |||
=== Disable swap === | === Disable swap === | ||