2023-01-10 09:35:00 +00:00
|
|
|
{ ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
services.espanso = {
|
|
|
|
enable = true;
|
2023-08-08 10:19:01 +00: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";
|
2023-01-10 09:35:00 +00:00
|
|
|
type = "date";
|
2023-08-08 10:19:01 +00:00
|
|
|
params = { format = "%d/%m/%Y"; };
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "currenttime";
|
|
|
|
type = "date";
|
|
|
|
params = { format = "%R"; };
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2023-01-10 09:35:00 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
test.stubs.espanso = { };
|
|
|
|
|
|
|
|
nmt.script = ''
|
|
|
|
serviceFile=home-files/.config/systemd/user/espanso.service
|
|
|
|
assertFileExists "$serviceFile"
|
|
|
|
assertFileContent "$serviceFile" ${./basic-configuration.service}
|
|
|
|
|
2023-08-08 10:19:01 +00:00
|
|
|
configFile=home-files/.config/espanso/config/default.yml
|
2023-01-10 09:35:00 +00:00
|
|
|
assertFileExists "$configFile"
|
|
|
|
assertFileContent "$configFile" ${./basic-configuration.yaml}
|
2023-08-08 10:19:01 +00:00
|
|
|
|
|
|
|
matchFile=home-files/.config/espanso/match/base.yml
|
|
|
|
assertFileExists "$matchFile"
|
|
|
|
assertFileContent "$matchFile" ${./basic-matches.yaml}
|
2023-01-10 09:35:00 +00:00
|
|
|
'';
|
|
|
|
}
|