about summary refs log tree commit diff
path: root/nixos/tests/earlyoom.nix
diff options
context:
space:
mode:
authorNaïm Favier <n@monade.li>2022-03-24 08:34:09 +0100
committerGitHub <noreply@github.com>2022-03-24 15:34:09 +0800
commita8296e75373762aa7cc3380f466ea3a1df804cf7 (patch)
tree2d3b5dbd9e092d3fb91cb59fc6466a85742295f2 /nixos/tests/earlyoom.nix
parent5f7799415a25cc47c1fbaa61298aab964d8b8b0a (diff)
nixos/earlyoom: bring the module up to date (#163663)
* nixos/earlyoom: bring the module up to date

Removes deprecated option `ignoreOOMScoreAdjust`, introduces `killHook`
as a replacement for `notificationsCommand`, and adds an `extraArgs`
option for things not covered by the module.

* nixos/earlyoom: add nixos test

* nixos/earlyoom: add reportInterval

Allows setting the interval for logging a memory report. Defaults to
3600 following upstream
     (https://github.com/rfjakob/earlyoom/blob/master/earlyoom.default#L5)
to avoid flooding logs.

* nixos/earlyoom: add free{Mem,Swap}KillThreshold

Fixes https://github.com/NixOS/nixpkgs/issues/83504
Diffstat (limited to 'nixos/tests/earlyoom.nix')
-rw-r--r--nixos/tests/earlyoom.nix16
1 files changed, 16 insertions, 0 deletions
diff --git a/nixos/tests/earlyoom.nix b/nixos/tests/earlyoom.nix
new file mode 100644
index 0000000000000..75bdf56899b30
--- /dev/null
+++ b/nixos/tests/earlyoom.nix
@@ -0,0 +1,16 @@
+import ./make-test-python.nix ({ lib, ... }: {
+  name = "earlyoom";
+  meta = {
+    maintainers = with lib.maintainers; [ ncfavier ];
+  };
+
+  machine = {
+    services.earlyoom = {
+      enable = true;
+    };
+  };
+
+  testScript = ''
+    machine.wait_for_unit("earlyoom.service")
+  '';
+})