fork/home-manager

git clone https://git.julia.blue/fork/home-manager

Li YangEspanso: Fix broken module to be compatible with Espanso version 2.x (#4066)1e5d741e

master
1.3 KiB56 linesraw
1{ ... }:
2
3{
4  services.espanso = {
5    enable = true;
6    configs = { default = { show_notifications = false; }; };
7    matches = {
8      base = {
9        matches = [
10          {
11            trigger = ":now";
12            replace = "It's {{currentdate}} {{currenttime}}";
13          }
14          {
15            trigger = ":hello";
16            replace = ''
17              line1
18              line2'';
19          }
20          {
21            regex = ":hi(?P<person>.*)\\.";
22            replace = "Hi {{person}}!";
23          }
24        ];
25        global_vars = [
26          {
27            name = "currentdate";
28            type = "date";
29            params = { format = "%d/%m/%Y"; };
30          }
31          {
32            name = "currenttime";
33            type = "date";
34            params = { format = "%R"; };
35          }
36        ];
37      };
38    };
39  };
40
41  test.stubs.espanso = { };
42
43  nmt.script = ''
44    serviceFile=home-files/.config/systemd/user/espanso.service
45    assertFileExists "$serviceFile"
46    assertFileContent "$serviceFile" ${./basic-configuration.service}
47
48    configFile=home-files/.config/espanso/config/default.yml
49    assertFileExists "$configFile"
50    assertFileContent "$configFile" ${./basic-configuration.yaml}
51
52    matchFile=home-files/.config/espanso/match/base.yml
53    assertFileExists "$matchFile"
54    assertFileContent "$matchFile" ${./basic-matches.yaml}
55  '';
56}