build02: add swap

This commit is contained in:
Jörg Thalheim 2022-11-09 09:05:46 +01:00
parent 669979b569
commit 57311f69a6
2 changed files with 7 additions and 0 deletions

View file

@ -3,6 +3,7 @@
{
imports = [
../roles/common.nix
../roles/swap.nix
../roles/hardware/hetzner-amd.nix
../roles/hetzner-network.nix
../roles/hercules-ci

6
roles/swap.nix Normal file
View file

@ -0,0 +1,6 @@
# https://github.com/zfsonlinux/pkg-zfs/wiki/HOWTO-use-a-zvol-as-a-swap-device
# zfs create -V 16G -b $(getconf PAGESIZE) -o logbias=throughput -o sync=always -o primarycache=metadata -o com.sun:auto-snapshot=false /dev/zvol/zroot/swap
# mkswap -f /dev/zvol/zroot/swap
{
swapDevices = [{ device = "/dev/zvol/zroot/swap"; }];
}