nix-env-selector
nix-env-selector copied to clipboard
[Feature]: Support multiple folders in workspace
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 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"
}
^ 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.
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
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.