1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-27 13:39:46 +01:00
home-manager/tests/modules/services/sxhkd/service.nix
Naïm Favier 14b5415720
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.
2023-10-24 17:48:13 +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 &'
'';
}