mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 17:03:01 +00:00
nixos/zram: support built-in zram
This commit is contained in:
parent
a63021a330
commit
be07c1bad9
@ -131,6 +131,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"
|
||||
'';
|
||||
@ -177,9 +179,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 New Issue
Block a user