mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-30 23:34:12 +03:00
nixos/zram: use nixos/zram-generator as backing implementation
This commit is contained in:
parent
a7e095d9fd
commit
0814089e05
@ -105,20 +105,9 @@ in
|
||||
}
|
||||
];
|
||||
|
||||
services.zram-generator.enable = true;
|
||||
|
||||
system.requiredKernelConfig = with config.lib.kernelConfig; [
|
||||
(isModule "ZRAM")
|
||||
];
|
||||
|
||||
# Disabling this for the moment, as it would create and mkswap devices twice,
|
||||
# once in stage 2 boot, and again when the zram-reloader service starts.
|
||||
# boot.kernelModules = [ "zram" ];
|
||||
|
||||
systemd.packages = [ pkgs.zram-generator ];
|
||||
systemd.services."systemd-zram-setup@".path = [ pkgs.util-linux ]; # for mkswap
|
||||
|
||||
environment.etc."systemd/zram-generator.conf".source =
|
||||
(pkgs.formats.ini { }).generate "zram-generator.conf" (lib.listToAttrs
|
||||
services.zram-generator.settings = lib.listToAttrs
|
||||
(builtins.map
|
||||
(dev: {
|
||||
name = dev;
|
||||
@ -134,7 +123,7 @@ in
|
||||
writeback-device = cfg.writebackDevice;
|
||||
};
|
||||
})
|
||||
devices));
|
||||
devices);
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user