Install shell-mommy (and run it on failed commands)
diff --git a/flake.lock b/flake.lock
index 94be9c6..aa1dd99 100644
--- a/flake.lock
+++ b/flake.lock
@@ -305,6 +305,23 @@
         "type": "github"
       }
     },
+    "mommy": {
+      "flake": false,
+      "locked": {
+        "lastModified": 1676484056,
+        "narHash": "sha256-9bW0n7qOETMY8GrOdaCgpZtPWaE6O040U91Ts42cut4=",
+        "owner": "sudofox",
+        "repo": "shell-mommy",
+        "rev": "b4e9f50cecd4ebbf39f8c426315e2040c5623db7",
+        "type": "github"
+      },
+      "original": {
+        "owner": "sudofox",
+        "repo": "shell-mommy",
+        "rev": "b4e9f50cecd4ebbf39f8c426315e2040c5623db7",
+        "type": "github"
+      }
+    },
     "nix-index-database": {
       "inputs": {
         "nixpkgs": [
@@ -553,6 +570,7 @@
         "impermanence": "impermanence",
         "kmonad": "kmonad",
         "lanzaboote": "lanzaboote",
+        "mommy": "mommy",
         "nix-index-database": "nix-index-database",
         "nixpkgs": "nixpkgs",
         "nixpkgs-minion": "nixpkgs-minion",
diff --git a/flake.nix b/flake.nix
index 6672843..f2aac48 100644
--- a/flake.nix
+++ b/flake.nix
@@ -18,6 +18,10 @@
       url = "github:nixos/flake-registry";
       flake = false;
     };
+    mommy = {
+      url = "github:sudofox/shell-mommy/b4e9f50cecd4ebbf39f8c426315e2040c5623db7";
+      flake = false;
+    };
     home-manager.url = "github:nix-community/home-manager";
     sops-nix.url = "github:Mic92/sops-nix";
     impermanence.url = "github:nix-community/impermanence";
diff --git a/modules/mommy.nix b/modules/mommy.nix
new file mode 100644
index 0000000..e60eda1
--- /dev/null
+++ b/modules/mommy.nix
@@ -0,0 +1,10 @@
+{ pkgs, mommy, ... }:
+let
+  mommy-script = pkgs.writeScript "mommy" (builtins.readFile "${mommy}/shell-mommy.sh");
+in
+{
+  home.programs.zsh.initExtra = ''
+    source ${mommy-script}
+    precmd() { if (( $? != 0 )); then; mommy false; fi }
+  '';
+}