From a9de0fa50e108a93c9a750c74da633ceded528f6 Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Sun, 1 Jun 2025 19:19:34 -0700 Subject: [PATCH] feat(callisto): reduce swapfile from 32gb -> 4gb --- reference/hosts/callisto/configuration.nix | 11 +++++++++++ reference/hosts/callisto/hardware-configuration.nix | 7 ------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/reference/hosts/callisto/configuration.nix b/reference/hosts/callisto/configuration.nix index b3b64e5..84b7a43 100755 --- a/reference/hosts/callisto/configuration.nix +++ b/reference/hosts/callisto/configuration.nix @@ -49,6 +49,17 @@ KERNEL=="macsmc-battery", SUBSYSTEM=="power_supply", ATTR{charge_control_end_threshold}="90", ATTR{charge_control_start_threshold}="85" ''; + swapDevices = + let + gb = x: x * 1024; + in + [ + { + device = "/var/lib/swapfile"; + size = gb 4; + } + ]; + services.keyd = { enable = true; keyboards = { diff --git a/reference/hosts/callisto/hardware-configuration.nix b/reference/hosts/callisto/hardware-configuration.nix index ea2786b..1877c91 100644 --- a/reference/hosts/callisto/hardware-configuration.nix +++ b/reference/hosts/callisto/hardware-configuration.nix @@ -38,13 +38,6 @@ ]; }; - swapDevices = [ - { - device = "/var/lib/swapfile"; - size = 32 * 1024; - } - ]; - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's # still possible to use this option, but it's recommended to use it in conjunction