While Nix dev shells solve the problem of defining a development environment, there is still the question of how developers enter that environment. This is where direnv comes in.
direnv is a lightweight utility that watches the current directory and automatically loads environment settings whenever you enter a project. When paired with a Nix dev shell, this means that simply changing into a repository directory is enough to activate the correct toolchain. No additional commands are required, and leaving the directory automatically restores your previous environment.
The result is a workflow that feels surprisingly natural. Instead of remembering which setup script to run or which environment to activate, developers simply navigate to the project they want to work on. The appropriate versions of all required tools become available automatically.
For teams, this removes a significant source of confusion. How many times has someone reported an issue only to discover they were using the wrong version of a CLI, SDK, or scripting language? By coupling the environment directly to the repository, the chances of these problems occurring are dramatically reduced.
Perhaps most importantly, this approach works just as well for z/OS developers as it does for teams targeting Linux or cloud-native platforms. Nix does not need to run on the remote z/OS system to provide value. Instead, it standardizes the workstation environment used to interact with that system, ensuring that every developer has a consistent and reproducible set of local tools.
In short, Nix and direnv are helping us tame everything around mainframe development. The less time we spend configuring workstations, troubleshooting missing dependencies, and maintaining setup documentation, the more time we can spend actually developing software.