diff options
Diffstat (limited to 'home-manager/tests/modules/services/sxhkd')
4 files changed, 67 insertions, 0 deletions
diff --git a/home-manager/tests/modules/services/sxhkd/configuration.nix b/home-manager/tests/modules/services/sxhkd/configuration.nix new file mode 100644 index 00000000000..992c4b18a94 --- /dev/null +++ b/home-manager/tests/modules/services/sxhkd/configuration.nix @@ -0,0 +1,30 @@ +{ config, ... }: { + config = { + services.sxhkd = { + enable = true; + + keybindings = { + "super + a" = "run command a"; + "super + b" = null; + "super + Shift + b" = "run command b"; + }; + + extraConfig = '' + super + c + call command c + + # comment + super + d + call command d + ''; + }; + + nmt.script = '' + local sxhkdrc=home-files/.config/sxhkd/sxhkdrc + + assertFileExists $sxhkdrc + + assertFileContent $sxhkdrc ${./sxhkdrc} + ''; + }; +} diff --git a/home-manager/tests/modules/services/sxhkd/default.nix b/home-manager/tests/modules/services/sxhkd/default.nix new file mode 100644 index 00000000000..ec25252cee0 --- /dev/null +++ b/home-manager/tests/modules/services/sxhkd/default.nix @@ -0,0 +1,4 @@ +{ + sxhkd-configuration = ./configuration.nix; + sxhkd-service = ./service.nix; +} diff --git a/home-manager/tests/modules/services/sxhkd/service.nix b/home-manager/tests/modules/services/sxhkd/service.nix new file mode 100644 index 00000000000..46ce259a718 --- /dev/null +++ b/home-manager/tests/modules/services/sxhkd/service.nix @@ -0,0 +1,20 @@ +{ config, ... }: +{ + config = { + services.sxhkd = { + enable = true; + extraPath = "/home/the-user/bin:/extra/path/bin"; + }; + + nmt.script = '' + local serviceFile=home-files/.config/systemd/user/sxhkd.service + + assertFileExists $serviceFile + + assertFileRegex $serviceFile 'ExecStart=.*/bin/sxhkd' + + assertFileRegex $serviceFile \ + 'Environment=PATH=.*\.nix-profile/bin:/home/the-user/bin:/extra/path/bin' + ''; + }; +} diff --git a/home-manager/tests/modules/services/sxhkd/sxhkdrc b/home-manager/tests/modules/services/sxhkd/sxhkdrc new file mode 100644 index 00000000000..c8883464b29 --- /dev/null +++ b/home-manager/tests/modules/services/sxhkd/sxhkdrc @@ -0,0 +1,13 @@ +super + Shift + b + run command b + +super + a + run command a + + +super + c + call command c + +# comment +super + d + call command d |