minion@greylag: add aliases for useful 1-liners

gpg-card-switch: Delete all subkey keygrips, avoiding gpg asking for the
                 old card

git stg-clean: Delete unapplied stg patches that share a Change-Id with
               anything in the log. Useful when gerrit has changed the
	       patch so stg doesn't know it's the same, but because of
	       the change ID we do

all replacements now enabled as per:
    change Ie670c620b42ea4b4bf44bc28efb1ea936102fa60

Change-Id: I09797c33ad6775202def6a4671c2011fc104f182
Reviewed-on: https://git.clicks.codes/c/Chimera/NixFiles/+/433
Reviewed-by: Skyler Grey <minion@clicks.codes>
Tested-by: Skyler Grey <minion@clicks.codes>
diff --git a/homes/x86_64-linux/minion@greylag/default.nix b/homes/x86_64-linux/minion@greylag/default.nix
index 6c4ca5f..9903133 100644
--- a/homes/x86_64-linux/minion@greylag/default.nix
+++ b/homes/x86_64-linux/minion@greylag/default.nix
@@ -34,6 +34,11 @@
     personal = "config user.email skyler3665@gmail.com";
     clicks = "config user.email minion@clicks.codes";
     collabora = "config user.email skyler.grey@collabora.com";
+    stg-clean = ''!for PATCH in $(stg series -PU); do CHANGE_ID=$(git show -s --format="%(trailers:key=Change-Id,valueonly,separator=%x2C )" $(stg id $PATCH)); git log --format="%(trailers:key=Change-Id,valueonly,separator=%x2C )" | grep -qFx "$CHANGE_ID" && stg delete $PATCH; done'';
+  };
+
+  home.shellAliases = {
+    gpg-card-switch = ''for keygrip in $(gpg --with-keygrip --list-secret-keys 76E0B09A741C4089522111E5F27E3E5922772E7A | grep Keygrip | sed "1d" | sed "s/ *Keygrip = //"); do gpg-connect-agent "delete_key $keygrip" /bye > /dev/null; done; gpg --card-status;'';
   };
 
   programs.git.extraConfig.user = {
@@ -85,6 +90,7 @@
 
     shell.bash.enable = true;
     shell.defaultAliases.enable = true;
+    shell.replacements.defaultEnable = true;
 
     theme.font.nerdFontGlyphs.enable = true;