my over complex system configurations dotfiles.isabelroses.com/
nixos nix flake dotfiles linux
9
fork

Configure Feed

Select the types of activity you want to include in your feed.

nixos/enviroment: remove zram; add zswap

oomfie said zswap is better for most cases

isabel a5330966 1fa5a4de

+15 -24
+1 -1
modules/nixos/environment/default.nix
··· 8 8 ./paths.nix # paths 9 9 ./wayland.nix # wayland settings 10 10 ./xdg.nix # move everything to nice placee 11 - ./zram.nix # zram optimisation and enabling 11 + ./zswap.nix # zswap optimisation and enabling 12 12 # keep-sorted end 13 13 ]; 14 14 }
-23
modules/nixos/environment/zram.nix
··· 1 - { lib, config, ... }: 2 - let 3 - inherit (lib) mkIf; 4 - in 5 - { 6 - # compress half of the ram to use as swap basically, get more memory per memory 7 - zramSwap = { 8 - enable = true; 9 - algorithm = "zstd"; 10 - 11 - # defaults to 50 12 - memoryPercent = 90; 13 - }; 14 - 15 - boot.kernel.sysctl = mkIf config.zramSwap.enable { 16 - # zram is relatively cheap, prefer swap 17 - "vm.swappiness" = 180; 18 - "vm.watermark_boost_factor" = 0; 19 - "vm.watermark_scale_factor" = 125; 20 - # zram is in memory, no need to readahead 21 - "vm.page-cluster" = 0; 22 - }; 23 - }
+14
modules/nixos/environment/zswap.nix
··· 1 + { lib, config, ... }: 2 + let 3 + inherit (lib) mkIf; 4 + in 5 + { 6 + # compress half of the ram to use as swap basically, get more memory per memory 7 + # <https://chrisdown.name/2026/03/24/zswap-vs-zram-when-to-use-what.html> 8 + boot.zswap = { 9 + enable = config.swapDevices != [ ]; 10 + 11 + # defaults are good when its not a server 12 + maxPoolPercent = mkIf config.garden.profiles.server.enable 15; 13 + }; 14 + }