about summary refs log tree commit diff
path: root/nixos/modules/config
diff options
context:
space:
mode:
authorVladimír Čunát <v@cunat.cz>2022-12-10 16:19:36 +0100
committerVladimír Čunát <v@cunat.cz>2022-12-10 16:19:36 +0100
commitde033ae75a79861108d4203ffdf2df4ed09c618b (patch)
tree9a61f37a5794f98a4ef7773ff77e87ec0d259681 /nixos/modules/config
parent7561ba5987b928c47ac2ffee8468e62940881b4f (diff)
parent60aa3fa6d7bc6ebbd1ad704ef8b3dbd28a115ae3 (diff)
Merge branch 'master' into staging-next
Diffstat (limited to 'nixos/modules/config')
-rw-r--r--nixos/modules/config/zram.nix8
1 files changed, 5 insertions, 3 deletions
diff --git a/nixos/modules/config/zram.nix b/nixos/modules/config/zram.nix
index cc2ca63144332..87ac53a60b7ed 100644
--- a/nixos/modules/config/zram.nix
+++ b/nixos/modules/config/zram.nix
@@ -132,6 +132,8 @@ in
       options zram num_devices=${toString cfg.numDevices}
     '';
 
+    boot.kernelParams = ["zram.num_devices=${toString cfg.numDevices}"];
+
     services.udev.extraRules = ''
       KERNEL=="zram[0-9]*", ENV{SYSTEMD_WANTS}="zram-init-%k.service", TAG+="systemd"
     '';
@@ -178,9 +180,9 @@ in
           serviceConfig = {
             Type = "oneshot";
             RemainAfterExit = true;
-            ExecStartPre = "${modprobe} -r zram";
-            ExecStart = "${modprobe} zram";
-            ExecStop = "${modprobe} -r zram";
+            ExecStartPre = "-${modprobe} -r zram";
+            ExecStart = "-${modprobe} zram";
+            ExecStop = "-${modprobe} -r zram";
           };
           restartTriggers = [
             cfg.numDevices