Skip to content
Snippets Groups Projects
Commit 645e30ce authored by Florian Sesser's avatar Florian Sesser
Browse files

Add the same 8 GB of encrypted swap space to all hosts

For consistency reasons: Even if they had a perfectly good swap
partition already, and also for AWS hosts.
parent a9bac240
No related branches found
No related tags found
No related merge requests found
...@@ -31,9 +31,12 @@ ...@@ -31,9 +31,12 @@
fsType = "zfs"; fsType = "zfs";
}; };
swapDevices = swapDevices = [ {
[ { device = "/dev/disk/by-uuid/f986a811-4912-4e9a-8bc3-01cb6926c4c6"; } device = "/var/swapfile";
]; size = 8192; # megabytes
randomEncryption = true;
} ];
nix.maxJobs = lib.mkDefault 24; nix.maxJobs = lib.mkDefault 24;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
......
...@@ -31,9 +31,11 @@ ...@@ -31,9 +31,11 @@
fsType = "ext4"; fsType = "ext4";
}; };
swapDevices = swapDevices = [ {
[ { device = "/dev/disk/by-uuid/f762b5e2-bbdd-4a02-bbd9-0bf6b11e0ab5"; } device = "/var/swapfile";
]; size = 8192; # megabytes
randomEncryption = true;
} ];
nix.maxJobs = lib.mkDefault 24; nix.maxJobs = lib.mkDefault 24;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
......
...@@ -31,7 +31,11 @@ ...@@ -31,7 +31,11 @@
fsType = "zfs"; fsType = "zfs";
}; };
swapDevices = [ ]; swapDevices = [ {
device = "/var/swapfile";
size = 8192; # megabytes
randomEncryption = true;
} ];
nix.maxJobs = lib.mkDefault 24; nix.maxJobs = lib.mkDefault 24;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
......
...@@ -26,7 +26,11 @@ ...@@ -26,7 +26,11 @@
fsType = "zfs"; fsType = "zfs";
}; };
swapDevices = [ ]; swapDevices = [ {
device = "/var/swapfile";
size = 8192; # megabytes
randomEncryption = true;
} ];
nix.maxJobs = lib.mkDefault 32; nix.maxJobs = lib.mkDefault 32;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
......
...@@ -31,7 +31,11 @@ ...@@ -31,7 +31,11 @@
fsType = "zfs"; fsType = "zfs";
}; };
swapDevices = [ ]; swapDevices = [ {
device = "/var/swapfile";
size = 8192; # megabytes
randomEncryption = true;
} ];
nix.maxJobs = lib.mkDefault 32; nix.maxJobs = lib.mkDefault 32;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
......
...@@ -2,6 +2,12 @@ ...@@ -2,6 +2,12 @@
imports = [ <nixpkgs/nixos/modules/virtualisation/amazon-image.nix> ]; imports = [ <nixpkgs/nixos/modules/virtualisation/amazon-image.nix> ];
ec2.hvm = true; ec2.hvm = true;
boot.kernel.sysctl = { "vm.swappiness" = 0; }; boot.kernel.sysctl = { "vm.swappiness" = 0; };
swapDevices = [ {
device = "/var/swapfile";
size = 8192; # megabytes
randomEncryption = true;
} ];
boot.supportedFilesystems = [ "zfs" ]; boot.supportedFilesystems = [ "zfs" ];
networking.hostId = "10000000"; networking.hostId = "10000000";
......
...@@ -2,4 +2,9 @@ ...@@ -2,4 +2,9 @@
imports = [ <nixpkgs/nixos/modules/virtualisation/amazon-image.nix> ]; imports = [ <nixpkgs/nixos/modules/virtualisation/amazon-image.nix> ];
ec2.hvm = true; ec2.hvm = true;
boot.kernel.sysctl = { "vm.swappiness" = 0; }; boot.kernel.sysctl = { "vm.swappiness" = 0; };
swapDevices = [ {
device = "/var/swapfile";
size = 8192; # megabytes
randomEncryption = true;
} ];
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment