From 70d794c753538349ab7ae9b33eb7b365e9f5f347 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Sun, 18 Aug 2024 23:14:30 -0400 Subject: [PATCH] feat: add swapfiles to devices without swap --- devices/binto/hardware-configuration.nix | 11 +++++++++-- devices/nos/hardware-configuration.nix | 7 +++++++ devices/servivi/hardware-configuration.nix | 7 +++++++ devices/wim/hardware-configuration.nix | 8 ++++++++ 4 files changed, 31 insertions(+), 2 deletions(-) diff --git a/devices/binto/hardware-configuration.nix b/devices/binto/hardware-configuration.nix index 22d17470..c26f357e 100644 --- a/devices/binto/hardware-configuration.nix +++ b/devices/binto/hardware-configuration.nix @@ -1,6 +1,5 @@ { config, - lib, modulesPath, pkgs, ... @@ -61,9 +60,17 @@ }; }; + swapDevices = [ + { + device = "/var/lib/swapfile"; + size = 16 * 1024; + } + ]; + zramSwap.enable = true; + hardware = { - cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + cpu.amd.updateMicrocode = config.hardware.enableRedistributableFirmware; uinput.enable = true; }; diff --git a/devices/nos/hardware-configuration.nix b/devices/nos/hardware-configuration.nix index 1e5dff83..0c6ddd2b 100644 --- a/devices/nos/hardware-configuration.nix +++ b/devices/nos/hardware-configuration.nix @@ -51,6 +51,13 @@ }; }; + swapDevices = [ + { + device = "/var/lib/swapfile"; + size = 16 * 1024; + } + ]; + zramSwap.enable = true; hardware.cpu.intel.updateMicrocode = config.hardware.enableRedistributableFirmware; diff --git a/devices/servivi/hardware-configuration.nix b/devices/servivi/hardware-configuration.nix index f598469f..2854f402 100644 --- a/devices/servivi/hardware-configuration.nix +++ b/devices/servivi/hardware-configuration.nix @@ -52,6 +52,13 @@ }; }; + swapDevices = [ + { + device = "/var/lib/swapfile"; + size = 16 * 1024; + } + ]; + zramSwap.enable = true; hardware.cpu.amd.updateMicrocode = config.hardware.enableRedistributableFirmware; diff --git a/devices/wim/hardware-configuration.nix b/devices/wim/hardware-configuration.nix index 267ec958..920149be 100644 --- a/devices/wim/hardware-configuration.nix +++ b/devices/wim/hardware-configuration.nix @@ -55,7 +55,15 @@ }; }; + swapDevices = [ + { + device = "/var/lib/swapfile"; + size = 16 * 1024; + } + ]; + zramSwap.enable = true; + hardware = { cpu.amd.updateMicrocode = config.hardware.enableRedistributableFirmware;