feat: refactored espanso config

This commit is contained in:
Nick 2025-06-01 14:55:05 -05:00
parent 3d6ee99ecb
commit 9eb6982341
9 changed files with 123 additions and 36 deletions

View file

@ -1,28 +1,30 @@
{
flake,
lib,
pkgs,
...
}:
let
matchHelper = trigger: replace: {
trigger = trigger;
replace = replace;
};
configPath = ./config;
configs = {
url = { inherit flake matchHelper; };
logic = { inherit matchHelper; };
debate = { inherit matchHelper; };
characters = { inherit matchHelper; };
academic = { inherit matchHelper; };
numbers = { inherit matchHelper; };
email = { inherit flake matchHelper; };
};
baseMatches = {
matches =
[ ]
++ (import (configPath + /base.nix) { inherit matchHelper; })
++ (import (configPath + /url.nix) { inherit flake matchHelper; })
++ (import (configPath + /logic.nix) { inherit matchHelper; })
++ (import (configPath + /debate.nix) { inherit matchHelper; })
++ (import (configPath + /characters.nix) { inherit matchHelper; })
++ (import (configPath + /academic.nix) { inherit matchHelper; })
++ (import (configPath + /superscript.nix) { inherit matchHelper; })
++ (import (configPath + /email.nix) { inherit flake matchHelper; });
matches = lib.concatMap (name: import (configPath + "/${name}.nix") configs.${name}) (
builtins.attrNames configs
);
};
in
{