From c0cfd32bf0dc688ae7a3a5709247de9f0270ed78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Na=C3=AFm=20Favier?= Date: Tue, 24 Oct 2023 17:48:13 +0200 Subject: [PATCH] sxhkd: set scope OOMPolicy to continue When a process inside the sxhkd scope is OOM killed, if the OOM policy is set to `stop` then the sxhkd scope itself will exit, terminating every process launched from the keyboard. This is undesirable, set it to `continue` instead to keep other processes running. --- modules/services/sxhkd.nix | 2 +- tests/modules/services/sxhkd/service.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/services/sxhkd.nix b/modules/services/sxhkd.nix index e955d00b1..cec453a0a 100644 --- a/modules/services/sxhkd.nix +++ b/modules/services/sxhkd.nix @@ -75,7 +75,7 @@ in { sxhkdCommand = "${cfg.package}/bin/sxhkd ${toString cfg.extraOptions}"; in '' systemctl --user stop sxhkd.scope 2> /dev/null || true - systemd-cat -t sxhkd systemd-run --user --scope -u sxhkd ${sxhkdCommand} & + systemd-cat -t sxhkd systemd-run --user --scope --property=OOMPolicy=continue -u sxhkd ${sxhkdCommand} & ''; }; } diff --git a/tests/modules/services/sxhkd/service.nix b/tests/modules/services/sxhkd/service.nix index 84f3086a8..5f49f7a57 100644 --- a/tests/modules/services/sxhkd/service.nix +++ b/tests/modules/services/sxhkd/service.nix @@ -21,6 +21,6 @@ 'systemctl --user stop sxhkd.scope 2> /dev/null || true' assertFileContains $xsessionFile \ - 'systemd-cat -t sxhkd systemd-run --user --scope -u sxhkd @sxhkd@/bin/sxhkd -m 1 &' + 'systemd-cat -t sxhkd systemd-run --user --scope --property=OOMPolicy=continue -u sxhkd @sxhkd@/bin/sxhkd -m 1 &' ''; }