cachix / devenv

Fast, Declarative, Reproducible, and Composable Developer Environments
https://devenv.sh
Apache License 2.0
3.47k stars 252 forks source link

Reuse `DEVENV_RUNTIME` to work around `nix develop` modifying `TMPDIR` #1157

Open sandydoo opened 2 weeks ago

sandydoo commented 2 weeks ago

Fixes #1153.

nix develop sets TMPDIR which changes the computed runtime dir between creating the shell and running devenv up. DEVENV_RUNTIME changes from /tmp/devenv-<hash> to /tmp/nix-shell.<hash>/devenv-<hash>.

This makes the flake-based devenv up error out because process-compose expects the runtime dir to exists when creating the unix socket. Non-flake devenv up is not affected by this, as it seems to create the new runtime dir before running the procfile.

On NixOS, this error doesn't show up because XDG_RUNTIME_DIR is set by default and is used as the tmpdir. This is not touched by nix develop.