From 36e19e3b306abf70df6f4a6580b226b6a11a85f9 Mon Sep 17 00:00:00 2001 From: Matthias Tafelmeier Date: Mon, 3 Jan 2022 18:26:23 +0100 Subject: [PATCH] infect: have swap usage optional (#91) Doesn't work everywhere with swapon, e.g. osuosl openstack cluster. Without swap it can succeed though, it's not a hard prerequisite for the infection to take effect. --- nixos-infect | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/nixos-infect b/nixos-infect index 650430e..c9c4ea6 100755 --- a/nixos-infect +++ b/nixos-infect @@ -310,10 +310,14 @@ infect() { checkEnv prepareEnv -makeSwap # smallest (512MB) droplet needs extra memory! +if [[ -z "$NO_SWAP" ]]; then + makeSwap # smallest (512MB) droplet needs extra memory! +fi makeConf infect -removeSwap +if [[ -z "$NO_SWAP" ]]; then + removeSwap +fi if [[ -z "$NO_REBOOT" ]]; then reboot