From fec59b0297f47603969c59451b7fb92c296f14a9 Mon Sep 17 00:00:00 2001 From: Default email Date: Mon, 2 Nov 2020 21:18:15 -0500 Subject: [PATCH] Project import generated by Copybara. GitOrigin-RevId: 34ad166a830d3ac1541dcce571c52231f2f0865a --- .../nixpkgs/nixos/modules/config/zram.nix | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/third_party/nixpkgs/nixos/modules/config/zram.nix b/third_party/nixpkgs/nixos/modules/config/zram.nix index ef6e89599e..5e9870bf6b 100644 --- a/third_party/nixpkgs/nixos/modules/config/zram.nix +++ b/third_party/nixpkgs/nixos/modules/config/zram.nix @@ -80,15 +80,6 @@ in ''; }; - memoryMax = mkOption { - default = null; - type = with types; nullOr int; - description = '' - Maximum total amount of memory (in bytes) that can be used by the zram - swap devices. - ''; - }; - priority = mkOption { default = 5; type = types.int; @@ -155,12 +146,7 @@ in # Calculate memory to use for zram mem=$(${pkgs.gawk}/bin/awk '/MemTotal: / { - value=int($2*${toString cfg.memoryPercent}/100.0/${toString devicesCount}*1024); - ${if cfg.memoryMax != null then '' - memory_max=int(${toString cfg.memoryMax}/${toString devicesCount}); - if (value > memory_max) { value = memory_max } - '' else ""} - print value + print int($2*${toString cfg.memoryPercent}/100.0/${toString devicesCount}*1024) }' /proc/meminfo) ${pkgs.utillinux}/sbin/zramctl --size $mem --algorithm ${cfg.algorithm} /dev/${dev}