devenv icon indicating copy to clipboard operation
devenv copied to clipboard

Prevent Project Directory from Being Copied into `/nix/store`

Open x-0D opened this issue 11 months ago • 1 comments

Description:

Currently, the behavior of the devenv tool includes copying the project directory (specified by $DEVENV_ROOT_FILE) into the /nix/store. This can lead to issues related to storage management and unwanted duplication of project files.

Expected Behavior:

The project directory should remain in its original location without being duplicated in the /nix/store. This will help maintain a cleaner environment and avoid potential conflicts or confusion arising from multiple copies of the same files.

Steps to Reproduce:

  1. Set up a project using devenv flake.nix with .envrc file .
  2. Run the direnv allow to initialize or build the environment.
  3. Check the /nix/store for any copies (*-source) of the project directory.

Actual Behavior:

The project directory is copied into /nix/store, leading to unnecessary duplication and possible critical security leakage

Additional Information:

This issue has been observed in various setups and may affect users who rely on a clean Nix environment. A solution that prevents this behavior would enhance usability and efficiency for developers using devenv.

maybe related with: https://github.com/NixOS/nix/issues/5551 https://github.com/NixOS/nix/issues/3121 https://github.com/NixOS/nix/issues/5574 and possible workaround https://github.com/direnv/direnv/issues/1103

please, update the docs with example flakes configurations that don't store users project into /nix/store

x-0D avatar Dec 09 '24 21:12 x-0D

It copies that only if you use flakes, not if you use devenv itself.

domenkozar avatar Dec 09 '24 21:12 domenkozar

Closing, this is a flake issue.

domenkozar avatar Aug 01 '25 19:08 domenkozar