mirror of
https://github.com/nix-community/home-manager
synced 2024-11-30 06:59:45 +01:00
1e5d741ea3
* Fix espanso module to work with 2.x version * espanso: fix espanso module This module is currently broken. It does not create `config` and `match` folders which are required by espanso 2.x version. This PR fixed this issue and support creating multiple files under `config` and `match` folder. * Espanso: fix espanso module This module is currently broken. It does not create `config` and `match` folders which are required by espanso 2.x version. This PR fixed this issue and support creating multiple files under `config` and `match` folder. Add descriptions * Add versionAtLeast and mkRemovedOptionModule * Correct maintainers list * remove config key from example * format basic-configuration.nix * Update modules/services/espanso.nix Co-authored-by: Naïm Favier <n@monade.li> * fix maintainers list --------- Co-authored-by: Naïm Favier <n@monade.li>
56 lines
1.3 KiB
Nix
56 lines
1.3 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=home-files/.config/systemd/user/espanso.service
|
|
assertFileExists "$serviceFile"
|
|
assertFileContent "$serviceFile" ${./basic-configuration.service}
|
|
|
|
configFile=home-files/.config/espanso/config/default.yml
|
|
assertFileExists "$configFile"
|
|
assertFileContent "$configFile" ${./basic-configuration.yaml}
|
|
|
|
matchFile=home-files/.config/espanso/match/base.yml
|
|
assertFileExists "$matchFile"
|
|
assertFileContent "$matchFile" ${./basic-matches.yaml}
|
|
'';
|
|
}
|