After installing the latest *env utility, I decided to stop and count how many of these things have accumulated in my shell.
- tfswitch for Terraform
- jenv for Java
- nvm for Node
- rvm for Ruby
- virtualenv for Python
Worse, each tool has a slightly different approach to the problem, so every time I switch projects I have to search the internet for instructions on how to use my own computer.
The which
command is all but useless, because every command is a “shim” script in ~/.some
directory.
When I open a new terminal tab, there’s a noticeable lag as Bash grinds through a mere 133 lines of ~/.bashrc
And all of this comes after a concerted effort to cull the things I wasn’t using.
I have had success using nix-shell to address this problem: https://nixos.wiki/wiki/Development_environment_with_nix-shell
For each project, I have a default.nix file in the project root to specify what dependencies (at a specific version) are needed for the project to build, run, etc. I type “nix-shell –pure” from the project root and away we go with all the deps needed :-)
Some references:
– https://ariya.io/2016/06/isolated-development-environment-using-nix
– https://nixos.org/nixos/nix-pills/developing-with-nix-shell.html
– An example Clojure-y defaut.nix: https://github.com/oakmac/record-linking-talk/blob/master/default.nix
I’ve enjoyed using https://github.com/asdf-vm/asdf