From af50f7f39d78dd2b3b96c7005529fdca559e0fad Mon Sep 17 00:00:00 2001 From: emmatherock Date: Mon, 21 Sep 2026 08:52:47 -0300 Subject: [PATCH] feat(homelab): update network and swap configuration --- hosts/miku-homelab/default.nix | 41 +++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/hosts/miku-homelab/default.nix b/hosts/miku-homelab/default.nix index 13c8819..a675afe 100644 --- a/hosts/miku-homelab/default.nix +++ b/hosts/miku-homelab/default.nix @@ -37,7 +37,7 @@ hostName = "miku-homelab"; useNetworkManager = true; staticIp = { - interface = "enp6s0"; + interface = "enp9s0"; address = "10.1.1.21"; prefixLength = 24; gateway = "10.1.1.1"; @@ -111,7 +111,35 @@ plymouth.enable = true; initrd.kernelModules = [ "amdgpu" ]; kernelPackages = pkgs.linuxPackages_latest; - kernelParams = [ "quiet" "splash" "boot.shell_on_fail" "loglevel=3" "iommu=pt" ]; + kernelParams = [ + "quiet" + "splash" + "boot.shell_on_fail" + "loglevel=3" + "iommu=pt" + "zswap.enabled=1" + "zswap.compressor=zstd" + "zswap.max_pool_percent=20" + "zswap.zpool=zsmalloc" + ]; + }; + + swapDevices = [ + { + device = "/dev/disk/by-label/optane-swap-1"; + priority = 50; + } + { + device = "/dev/disk/by-label/optane-swap-2"; + priority = 50; + } + ]; + + zramSwap = { + enable = true; + algorithm = "zstd"; + memoryPercent = 50; + priority = 100; }; time.timeZone = "America/Argentina/Buenos_Aires"; @@ -147,7 +175,7 @@ wantedBy = [ "multi-user.target" ]; serviceConfig = { Type = "oneshot"; - ExecStart = "${pkgs.ethtool}/bin/ethtool -K enp6s0 rx-udp-gro-forwarding on rx-gro-list on"; + ExecStart = "${pkgs.ethtool}/bin/ethtool -K enp9s0 rx-udp-gro-forwarding on rx-gro-list on"; RemainAfterExit = true; }; }; @@ -157,12 +185,5 @@ experimental-features = [ "nix-command" "flakes" ]; }; - zramSwap = { - enable = true; - algorithm = "zstd"; - memoryPercent = 50; - priority = 100; - }; - system.stateVersion = "25.11"; }