How to mimic nix-shell?

Run Settings
In [1] we see that nix-shell is implemented by running a command inside a builder. This builder is a stdenv builder, as we see in [2] and [3]. The stdenv builder invokes the function we see in [4] for every package that is a build input (i.e. given to nix-shell with -p). This function is called in [5] which is called in [6]. Replicating this behavior will require a similar Bash script; since setup hooks—sourced at [7]—are written in Bash. [1]: [2]: [3]: [4]: [5]: [6]: [7]:
Editor Settings
Key bindings
Full width