From 7c5461892c827654148755f82204cef4b4d61057 Mon Sep 17 00:00:00 2001
From: Oliver Davies <oliver@oliverdavies.dev>
Date: Wed, 20 Nov 2024 22:42:14 +0000
Subject: [PATCH] Update espanso matches

---
 nix/modules/home-manager/espanso.nix          |  4 +++-
 .../home-manager/espanso/matches/base.nix     | 21 ++++++++++++-------
 2 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/nix/modules/home-manager/espanso.nix b/nix/modules/home-manager/espanso.nix
index 59b1e3b9..8867fe9c 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 a48232ee..57204c50 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";