From dbc4543812ab9cee01ed800d2da91a644aa65be3 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 12 Mar 2019 21:24:44 -0400 Subject: [PATCH] nixos/virtualbox: add swap file Puts 2G swap in /var/swap of OVA. This serves as backup when you hit the memory cap for the image. Fixes #57171 and fixes #22696 --- nixos/modules/virtualisation/virtualbox-image.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nixos/modules/virtualisation/virtualbox-image.nix b/nixos/modules/virtualisation/virtualbox-image.nix index 037c0d2f0d82..a9cb61c7164a 100644 --- a/nixos/modules/virtualisation/virtualbox-image.nix +++ b/nixos/modules/virtualisation/virtualbox-image.nix @@ -99,6 +99,11 @@ in { boot.growPartition = true; boot.loader.grub.device = "/dev/sda"; + swap.swapDevices = { + device = "/var/swap"; + size = 2048; + }; + virtualisation.virtualbox.guest.enable = true; };