Dev shell without adding to git, or copying repo to store

Hey folks,

I’m trying to set up dev shells for projects where I can’t necessarily commit the flake configuration/lock, and am also using dotenv. For now I have the following in my .envrc:

use flake path:.

This works in that it doesn’t require my flake to be added to git, but it seems to copy my repo into the store, which is not what I want. Is there some way to a) not have to commit my flake and b) not have my employer’s proprietary code in my store?

Thanks.

If you don’t want that behaviour you can’t use flakes. That’s baked into the design.

EDIT: I misread the question and should be ignored :upside_down_face:

use flake path:../devenv

This is how I deal with it at work and FOSS. Basically any project I don’t own.

Put the flake itself into a subdirectory? That way, it should only copy that subdirectory (containing only flake.nix and flake.lock) instead of the whole repo.

Also, you could add this directory name to a global .gitignore so that you don’t accidentally add/commit it.

Or just put it into .git/info/exclude per repo.