diff --git a/flake.lock b/flake.lock
index 5ba78f0..3ffda1b 100644
--- a/flake.lock
+++ b/flake.lock
@@ -34,10 +34,27 @@
         "type": "github"
       }
     },
+    "nixpkgs_bash51": {
+      "locked": {
+        "lastModified": 1671056470,
+        "narHash": "sha256-rrcDHjRX9R8qXvkcGvKunsw3mf7zyPJzx1y8TPqjWdM=",
+        "owner": "NixOS",
+        "repo": "nixpkgs",
+        "rev": "79b3d4bcae8c7007c9fd51c279a8a67acfa73a2a",
+        "type": "github"
+      },
+      "original": {
+        "owner": "NixOS",
+        "repo": "nixpkgs",
+        "rev": "79b3d4bcae8c7007c9fd51c279a8a67acfa73a2a",
+        "type": "github"
+      }
+    },
     "root": {
       "inputs": {
         "flake-utils": "flake-utils",
-        "nixpkgs": "nixpkgs"
+        "nixpkgs": "nixpkgs",
+        "nixpkgs_bash51": "nixpkgs_bash51"
       }
     },
     "systems": {
diff --git a/flake.nix b/flake.nix
index 85e19fd..13b30bb 100644
--- a/flake.nix
+++ b/flake.nix
@@ -2,30 +2,35 @@
   description = "Development environment for nu_plugin_bash_env.";
 
   inputs = {
-    nixpkgs.url = github:NixOS/nixpkgs/nixpkgs-unstable;
+    nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
+    # https://lazamar.co.uk/nix-versions/?channel=nixpkgs-unstable&package=bash
+    nixpkgs_bash51.url = "github:NixOS/nixpkgs?rev=79b3d4bcae8c7007c9fd51c279a8a67acfa73a2a";
     flake-utils.url = "github:numtide/flake-utils";
   };
 
-  outputs = { self, nixpkgs, flake-utils }:
+  outputs = { self, nixpkgs, nixpkgs_bash51, flake-utils }:
     flake-utils.lib.eachDefaultSystem
       (system:
         let
           pkgs = import nixpkgs {
             inherit system;
           };
-          nu_plugin_bash_env = pkgs.writeShellScriptBin "nu_plugin_bash_env"
-            (builtins.replaceStrings ["jq" "(cat)" " sed "] ["${pkgs.jq}/bin/jq" "(${pkgs.coreutils}/bin/cat)" " ${pkgs.gnused}/bin/sed "]
+          pkgs_bash51 = import nixpkgs_bash51 {
+            inherit system;
+          };
+          nu_plugin_bash_env = pkgs_bash51.writeShellScriptBin "nu_plugin_bash_env"
+            (builtins.replaceStrings [ "jq" "(cat)" " sed " ] [ "${pkgs.jq}/bin/jq" "(${pkgs.coreutils}/bin/cat)" " ${pkgs.gnused}/bin/sed " ]
               (builtins.readFile ./nu_plugin_bash_env));
         in
-          with pkgs;
-          {
-            devShells.default = mkShell {
-              nativeBuildInputs = [
-                bashInteractive
-                jq
-              ];
-            };
-            packages.default = nu_plugin_bash_env;
-          }
+        with pkgs;
+        {
+          devShells.default = mkShell {
+            nativeBuildInputs = [
+              pkgs_bash51.bashInteractive
+              jq
+            ];
+          };
+          packages.default = nu_plugin_bash_env;
+        }
       );
 }