diff --git a/nix/shell.nix b/nix/shell.nix
index 5c2fb28d6962f5713db8a01cd3ed420c28fce612..c170e4e277950798405e9fc63214d6401e1670f6 100644
--- a/nix/shell.nix
+++ b/nix/shell.nix
@@ -21,4 +21,10 @@ in with nixpkgs; pkgs.mkShell {
 
     ncurses5
   ];
+  shellHook = ''
+    # For esp.py openocd integration.
+    export OPENOCD_SCRIPTS="${pkgs.openocd-esp32-bin}/share/openocd/scripts"
+    # For GDB to be able to find libpython2.7 (????).
+    export LD_LIBRARY_PATH="${pkgs.python2}/lib:$LD_LIBRARY_PATH"
+  '';
 }