Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
47 lines
1.1 KiB
Nix
47 lines
1.1 KiB
Nix
{
|
|
name = "zram-generator";
|
|
|
|
nodes = {
|
|
single =
|
|
{ ... }:
|
|
{
|
|
virtualisation = {
|
|
emptyDiskImages = [ 512 ];
|
|
};
|
|
zramSwap = {
|
|
enable = true;
|
|
priority = 10;
|
|
algorithm = "lz4";
|
|
swapDevices = 1;
|
|
memoryPercent = 30;
|
|
memoryMax = 10 * 1024 * 1024;
|
|
writebackDevice = "/dev/vdb";
|
|
};
|
|
};
|
|
machine =
|
|
{ ... }:
|
|
{
|
|
zramSwap = {
|
|
enable = true;
|
|
priority = 10;
|
|
algorithm = "lz4";
|
|
swapDevices = 2;
|
|
memoryPercent = 30;
|
|
memoryMax = 10 * 1024 * 1024;
|
|
};
|
|
};
|
|
};
|
|
|
|
testScript = ''
|
|
single.wait_for_unit("systemd-zram-setup@zram0.service")
|
|
|
|
machine.wait_for_unit("systemd-zram-setup@zram0.service")
|
|
machine.wait_for_unit("systemd-zram-setup@zram1.service")
|
|
zram = machine.succeed("zramctl --noheadings --raw")
|
|
swap = machine.succeed("swapon --show --noheadings --raw")
|
|
for i in range(2):
|
|
assert f"/dev/zram{i} lz4 10M" in zram
|
|
assert f"/dev/zram{i} partition 10M" in swap
|
|
'';
|
|
}
|