mirror of
https://github.com/nix-community/home-manager
synced 2024-11-30 15:09:46 +01:00
56 lines
1.4 KiB
Nix
56 lines
1.4 KiB
Nix
|
{ ... }: {
|
||
|
services.espanso = {
|
||
|
enable = true;
|
||
|
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";
|
||
|
type = "date";
|
||
|
params = { format = "%d/%m/%Y"; };
|
||
|
}
|
||
|
{
|
||
|
name = "currenttime";
|
||
|
type = "date";
|
||
|
params = { format = "%R"; };
|
||
|
}
|
||
|
];
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
|
||
|
test.stubs.espanso = { };
|
||
|
|
||
|
nmt.script = ''
|
||
|
serviceFile="LaunchAgents/org.nix-community.home.espanso.plist"
|
||
|
serviceFileNormalized="$(normalizeStorePaths "$serviceFile")"
|
||
|
assertFileExists $serviceFile
|
||
|
assertFileContent $serviceFileNormalized ${./launchd.plist}
|
||
|
|
||
|
configFile=home-files/.config/espanso/config/default.yml
|
||
|
assertFileExists "$configFile"
|
||
|
assertFileContent "$configFile" ${../espanso/basic-configuration.yaml}
|
||
|
|
||
|
matchFile=home-files/.config/espanso/match/base.yml
|
||
|
assertFileExists "$matchFile"
|
||
|
assertFileContent "$matchFile" ${../espanso/basic-matches.yaml}
|
||
|
'';
|
||
|
}
|