Giter VIP home page Giter VIP logo

Comments (6)

jul1u5 avatar jul1u5 commented on May 23, 2024 1

That's cool. Let me know when you finish the rewrite. I can help with implementing this feature.

from nix-env-selector.

arrterian avatar arrterian commented on May 23, 2024

@jul1u5 Hi, thank you for the enhancement proposal.
In the current feature request, I found a couple of reasonable ideas for the further evolution of the extension.

  • Finding and autocompletion packages from nixpkgs by separate command
  • Ability to generate an environment for particular workspace in fly with a couple of commands

Staff that should be considered implemented another way
I think it's no so good idea to save a list of configured packages in .vscode workspace setting file. The reason is duplication places where the packages can be listed. Will better to generate <config>.nix file as output for the command if not exist yet and modify existed when the package list should be updated.

PS: Appreciate your feedback and welcome to the discussion 🙂

from nix-env-selector.

jul1u5 avatar jul1u5 commented on May 23, 2024

Hi, @arrterian, sorry for the delay.
I have given some thought to your idea of generating some <config>.nix file instead of putting the list of packages in .vscode/settings.json file. Single-source of truth seems more desirable. However, I have thought of some edge-cases:

Suppose a project already contains a shell.nix file.

  • Should the command figure out where to put the dependency in the file all by itself? That seems quite complicated, because, for instance, there could be buildInputs, buildNativeInputs lists specified in the file.
  • Perhaps VS Code could parse shell.nix file and add the package to buildInputs list by default. If there is no buildInputs specified, the command could show a warning. However, implementing the parser for the Nix language would complicate the project a lot, wouldn't it?

Just for reference when using, for example, nix-shell -p tree the shell will ignore any .nix files in the directory, and only load tree together with the current user environment.
Maybe it wouldn't be that bad to put the package list in the .vscode directory? The user could still see where the packages are loaded from when using Select Environment command. If some file like shell.nix is already selected (instead of an internal environment in .vscode dir), the command for adding packages would refuse to add them and display a warning.

What are your thoughts?

from nix-env-selector.

arrterian avatar arrterian commented on May 23, 2024

@jul1u5 I think the way storing packages for nix-shell -p in .vscode/settings.json is most comfortable and fast to implement.

For now, I am rewriting the extension to Purescript. It reasonable to proceed with adding new features after the rewriting process will end.

from nix-env-selector.

blaggacao avatar blaggacao commented on May 23, 2024

This should be doable via devshell's toml file.

from nix-env-selector.

arrterian avatar arrterian commented on May 23, 2024

Added in #44
Released in v1.0.0
Please, read CHANGELOG.md for more info.

from nix-env-selector.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.