Merge pull request #188958 from lheckemann/zram-builtin
nixos/zram: support built-in zram
This commit is contained in:
commit
2ee8b6ee74
1 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue