diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index 22f2200..b470d0e 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -11,7 +11,9 @@ jobs:
         pg-version: ['12', '13', '14', '15', '16']
 
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
+        with:
+          submodules: true
       - uses: cachix/install-nix-action@v18
         with:
           nix_path: nixpkgs=channel:nixos-unstable
diff --git a/.gitignore b/.gitignore
index 829f09c..515c26d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,5 @@
 *.lex.c
 results/
 .history
+*.so
+*.bc
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..c9c3e69
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "mustach"]
+	path = mustach
+	url = https://gitlab.com/jobol/mustach.git
diff --git a/README.md b/README.md
index c1c90d4..36918f2 100644
--- a/README.md
+++ b/README.md
@@ -87,13 +87,35 @@ select show_cat('Mr. Sleepy', false);
 
 ## Installation
 
-Install https://gitlab.com/jobol/mustach, then on this repo:
+Clone the repo and submodules:
 
 ```
-$ make && make install
+git clone --recurse-submodules https://github.com/PostgREST/plmustache
 ```
 
-Tested on Postgres 12, 13, 14, 15, 16.
+Build mustach:
+
+```
+cd mustach
+make && sudo make install
+sudo ldconfig
+```
+
+Build plmustache:
+
+```
+cd ..
+
+make && sudo make install
+```
+
+Then on SQL you can do:
+
+```sql
+CREATE EXTENSION plmustache;
+```
+
+plmustache is tested on Postgres 12, 13, 14, 15, 16.
 
 ## Development
 
diff --git a/mustach b/mustach
new file mode 160000
index 0000000..bd8a410
--- /dev/null
+++ b/mustach
@@ -0,0 +1 @@
+Subproject commit bd8a41030099c079aff57fcdfb1f5c0aa08cdbaf
diff --git a/nix/mustach.nix b/nix/mustach.nix
index 84414cf..aa97f7e 100644
--- a/nix/mustach.nix
+++ b/nix/mustach.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitLab, pkg-config }:
+{ lib, stdenv, pkg-config }:
 
 stdenv.mkDerivation rec {
   pname = "mustach";
@@ -8,10 +8,5 @@ stdenv.mkDerivation rec {
 
   makeFlags = [ "PREFIX=$(out)" "VERSION=${version}"];
 
-  src = fetchFromGitLab {
-    owner = "jobol";
-    repo = pname;
-    rev    = "bd8a41030099c079aff57fcdfb1f5c0aa08cdbaf";
-    sha256 = "sha256-3kdXLp40QZo1+JoQUQNHOxuh/9cHhWvpz/ZFQ2MFXW8=";
-  };
+  src = ../mustach;
 }