Commit 196648bccf73

Vincent Demeester <vincent@sbr.pm>
2026-01-07 16:04:33
feat(systems): Add swap configuration to multiple hosts
Add swapfile configurations to improve memory management: - athena, demeter (Raspberry Pi): 2GB swap - aion, rhea, kyushu: 8GB swap Swapfiles are automatically created and managed by NixOS without requiring manual partitioning or reinstallation. Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 0119408
Changed files (5)
systems/aion/hardware.nix
@@ -8,7 +8,12 @@ _: {
     fsType = "ext4";
   };
 
-  swapDevices = [ ];
+  swapDevices = [
+    {
+      device = "/swapfile";
+      size = 8 * 1024; # 8GB
+    }
+  ];
 
   hardware = {
     deviceTree = {
systems/athena/hardware.nix
@@ -6,4 +6,11 @@ _: {
       options = [ "noatime" ];
     };
   };
+
+  swapDevices = [
+    {
+      device = "/swapfile";
+      size = 2 * 1024; # 2GB
+    }
+  ];
 }
systems/demeter/hardware.nix
@@ -6,4 +6,11 @@ _: {
       options = [ "noatime" ];
     };
   };
+
+  swapDevices = [
+    {
+      device = "/swapfile";
+      size = 2 * 1024; # 2GB
+    }
+  ];
 }
systems/kyushu/hardware.nix
@@ -11,6 +11,13 @@
     ../common/services/nfs-mounts.nix
   ];
 
+  swapDevices = [
+    {
+      device = "/swapfile";
+      size = 8 * 1024; # 8GB
+    }
+  ];
+
   hardware = {
     # opengl.extraPackages = with pkgs; [ vaapiIntel libvdpau-va-gl vaapiVdpau intel-ocl intel-media-driver ];
   };
systems/rhea/hardware.nix
@@ -11,7 +11,12 @@
 
   networking.hostId = builtins.substring 0 8 (builtins.hashString "md5" config.networking.hostName);
 
-  swapDevices = [ ];
+  swapDevices = [
+    {
+      device = "/swapfile";
+      size = 8 * 1024; # 8GB
+    }
+  ];
 
   hardware = {
     deviceTree = {