home-manager/tests/modules/services/sxhkd/service.nix
2021-06-16 23:57:58 +02:00

35 lines
667 B
Nix

{ config, pkgs, ... }:
let
expectedFileRegex = ''
systemctl --user stop sxhkd.scope 2> /dev/null || true
systemd-cat -t sxhkd systemd-run --user --scope -u sxhkd \
@sxhkd@/bin/sxhkd -m 1 &
'';
in
{
config = {
xsession = {
enable = true;
windowManager.command = "";
};
services.sxhkd = {
enable = true;
package = pkgs.runCommandLocal "dummy-package" { } "mkdir $out" // { outPath = "@sxhkd@"; };
extraOptions = [ "-m 1" ];
};
nmt.script = ''
xsessionFile=home-files/.xsession
assertFileExists $xsessionFile
assertFileRegex $xsessionFile ${expectedFileRegex}
'';
};
}