nix-env-selector icon indicating copy to clipboard operation
nix-env-selector copied to clipboard

[Feature]: Support multiple folders in workspace

Open tbenst opened this issue 4 years ago • 4 comments

Is your feature request related to a problem? Please describe. Currently, *.nix files are only found in workspace root. If there are two folders in workspace, no *.nix files are found.

Describe the solution you'd like I'd like to find any *.nix file in top-level folders

Describe alternatives you've considered Recursively searching all folders may be useful in some cases, but just searching the root for each folder in workspace is sufficient for my needs.

Additional context Awesome extension, thanks so much :smile:

tbenst avatar Dec 06 '19 06:12 tbenst

@tbenst Thank you for the issue. Now, priority for the project is rewriting the codebase to PureScript and bug fixing. I'll keep the issue in our backlog.

Also, I have good news. You can already use the extension for your propose. All you need is add the following config to your project

{
    "nixEnvSelector.nixShellConfig": "/full/path/to/default.nix"
}

arrterian avatar Dec 06 '19 12:12 arrterian

^ this solution works great, thanks! After heavily using nix-env-selector for a few days, I find that I'm copying the same *.nix envs to multiple folders. Perhaps the better feature request is to specify a list of directories for nix-env-selector to search for *.nix files? e.g.

{
    "nixEnvSelector.nixShellDirectories": [ "/folder1" "/folder2" ]
}

That way could customize on both user and workspace level.

tbenst avatar Dec 12 '19 23:12 tbenst

I think this could be fixed by making use of: ${workspaceFolder} instead of the deprecated ${workspaceRoot}: See: https://code.visualstudio.com/docs/editor/variables-reference#_why-isnt-workspaceroot-documented

knedlsepp avatar Jun 18 '20 07:06 knedlsepp

I'd also like to suggest the ability to use shell.nix files that are not in the workspace root, but somewhere deeper in the directory structure. I often work in "monorepo" scenarios where the shell.nix file I need to enable is not directly in the workspace root directory.

samuela avatar Aug 24 '21 05:08 samuela