2021-10-25 00:27:41 +02:00
|
|
|
{ ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
services.espanso = {
|
|
|
|
enable = true;
|
2023-06-09 12:05:01 +02:00
|
|
|
configs = { default = { show_notifications = false; }; };
|
|
|
|
matches = {
|
|
|
|
base = {
|
|
|
|
matches = [
|
|
|
|
{
|
|
|
|
trigger = ":now";
|
|
|
|
replace = "It's {{currentdate}} {{currenttime}}";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
trigger = ":hello";
|
|
|
|
replace = ''
|
|
|
|
line1
|
|
|
|
line2'';
|
|
|
|
}
|
|
|
|
{
|
|
|
|
regex = ":hi(?P<person>.*)\\.";
|
|
|
|
replace = "Hi {{person}}!";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
global_vars = [
|
|
|
|
{
|
|
|
|
name = "currentdate";
|
2021-10-25 00:27:41 +02:00
|
|
|
type = "date";
|
2023-06-09 12:05:01 +02:00
|
|
|
params = { format = "%d/%m/%Y"; };
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "currenttime";
|
|
|
|
type = "date";
|
|
|
|
params = { format = "%R"; };
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2021-10-25 00:27:41 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
test.stubs.espanso = { };
|
|
|
|
|
|
|
|
nmt.script = ''
|
|
|
|
serviceFile=home-files/.config/systemd/user/espanso.service
|
|
|
|
assertFileExists "$serviceFile"
|
|
|
|
assertFileContent "$serviceFile" ${./basic-configuration.service}
|
|
|
|
|
2023-06-09 12:05:01 +02:00
|
|
|
configFile=home-files/.config/espanso/config/default.yml
|
2021-10-25 00:27:41 +02:00
|
|
|
assertFileExists "$configFile"
|
|
|
|
assertFileContent "$configFile" ${./basic-configuration.yaml}
|
2023-06-09 12:05:01 +02:00
|
|
|
|
|
|
|
matchFile=home-files/.config/espanso/match/base.yml
|
|
|
|
assertFileExists "$matchFile"
|
|
|
|
assertFileContent "$matchFile" ${./basic-matches.yaml}
|
2021-10-25 00:27:41 +02:00
|
|
|
'';
|
|
|
|
}
|