From 12d5afb47daab94250ea73f37318f7e058e5fb20 Mon Sep 17 00:00:00 2001 From: Guanran Wang Date: Sun, 5 Nov 2023 17:35:05 +0800 Subject: [PATCH] nixos,presets: add zram-generator --- flake.nix | 1 + nixos/presets/core/zram-generator.nix | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 nixos/presets/core/zram-generator.nix diff --git a/flake.nix b/flake.nix index 023b747..ddbe9da 100755 --- a/flake.nix +++ b/flake.nix @@ -170,6 +170,7 @@ # OS ./nixos/presets/desktop.nix ./nixos/presets/core/no-bootloader-menu.nix + ./nixos/presets/core/zram-generator.nix ./nixos/presets/desktop/gaming.nix ./nixos/presets/desktop/virtualbox.nix ./nixos/presets/desktop/wayland.nix diff --git a/nixos/presets/core/zram-generator.nix b/nixos/presets/core/zram-generator.nix new file mode 100644 index 0000000..3fe230b --- /dev/null +++ b/nixos/presets/core/zram-generator.nix @@ -0,0 +1,9 @@ +{...}: { + services.zram-generator = { + enable = true; + settings.zram0 = { + compression-algorithm = "zstd"; + zram-size = "ram"; + }; + }; +}