diff --git a/nix/modules/home-manager/espanso.nix b/nix/modules/home-manager/espanso.nix index 59b1e3b..8867fe9 100644 --- a/nix/modules/home-manager/espanso.nix +++ b/nix/modules/home-manager/espanso.nix @@ -1,3 +1,5 @@ +{ lib, ... }: + { services.espanso = { enable = true; @@ -10,7 +12,7 @@ }; matches = { - base = import ./espanso/matches/base.nix; + base = import ./espanso/matches/base.nix { inherit lib; }; }; }; } diff --git a/nix/modules/home-manager/espanso/matches/base.nix b/nix/modules/home-manager/espanso/matches/base.nix index a48232e..57204c5 100644 --- a/nix/modules/home-manager/espanso/matches/base.nix +++ b/nix/modules/home-manager/espanso/matches/base.nix @@ -1,10 +1,19 @@ +{ lib, ... }: + let + inherit (lib) removePrefix; + websiteUrl = "https://www.oliverdavies.uk"; dailyUrl = "https://dailydrupaler.com"; + githubUrl = "https://github.com/opdavies"; podcastUrl = "https://beyondblockspodcast.com"; in { matches = [ + { + trigger = ":email"; + replace = "oliver@${removePrefix "https://www." websiteUrl}"; + } { trigger = ":archive"; replace = "${websiteUrl}/archive"; @@ -26,16 +35,12 @@ in replace = "${dailyUrl}"; } { - trigger = ":dotfiles"; - replace = "https://github.com/opdavies/dotfiles.nix"; + trigger = ":dot"; + replace = "${githubUrl}/dotfiles"; } { - trigger = ":dc"; - replace = "Drupal Commerce"; - } - { - trigger = ":dr"; - replace = "Drupal"; + trigger = ":gh"; + replace = "${githubUrl}"; } { trigger = ":gt";