Swap: Difference between revisions

imported>Yuu
No edit summary
imported>Yuu
No edit summary
Line 1: Line 1:
== Configuration ==
Swap on NixOS is set with the option <code>swapDevices</code> on <code>/etc/nixos/hardware-configuration.nix</code>.


== Disable swap ==  
 
Swap on NixOS is set with the option: <code>swapDevices</code>. This will be in hardware-configuration-nix.
=== Disable swap ===
To remove all swap devices from NixOS you must therefore set
To remove all swap devices from NixOS, set


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
Line 8: Line 10:
</syntaxhighlight>
</syntaxhighlight>


This will remove the swap partition/file from being included in <code>/etc/fstab</code>
This will remove the swap partition or file from being included in <code>/etc/fstab</code>.
 
If you are using GPT partitioning tables <code>systemd-gpt-auto-generator(8)</code> will still mount your swap partition automatically.
 
You must therefore turn on attribute 63 on your partition in the partition table.


This can be done with gptfdisk or similar:
If you are using GPT partitioning tables, <code>systemd-gpt-auto-generator(8)</code> will still mount your swap partition automatically. You must therefore turn on attribute 63 on your partition in the partition table. This can be done with gptfdisk or similar:


<syntaxhighlight lang="console">
<syntaxhighlight lang="console">