1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-15 07:39:46 +01:00
home-manager/tests/modules/services/sxhkd/service.nix
Naïm Favier c0cfd32bf0
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.
2024-04-10 21:26:31 +02:00

26 lines
608 B
Nix

{ config, pkgs, ... }:
{
xsession = {
enable = true;
windowManager.command = "";
};
services.sxhkd = {
enable = true;
package = config.lib.test.mkStubPackage { outPath = "@sxhkd@"; };
extraOptions = [ "-m 1" ];
};
nmt.script = ''
xsessionFile=home-files/.xsession
assertFileExists $xsessionFile
assertFileContains $xsessionFile \
'systemctl --user stop sxhkd.scope 2> /dev/null || true'
assertFileContains $xsessionFile \
'systemd-cat -t sxhkd systemd-run --user --scope --property=OOMPolicy=continue -u sxhkd @sxhkd@/bin/sxhkd -m 1 &'
'';
}