Giter VIP home page Giter VIP logo

Comments (9)

drupol avatar drupol commented on May 28, 2024

Hi !

I had many thoughts about that feature already... But I like the flexibility that the current situation offers.

Let's say we implements your proposal, what would you suggest when the user wants to use the upper version instead of the lower one ?

from nix-shell.

ostrolucky avatar ostrolucky commented on May 28, 2024

If users wants default, inferred from composer.json, they use nix shell github:loophp/nix-shell --impure. If they want specific one, they use nix shell github:loophp/nix-shell#php82 --impure

from nix-shell.

drupol avatar drupol commented on May 28, 2024

Having the composer.json if you want a file to be read by Nix, then the --impure flag needs to be added. Without that flag, Nix won't be able to read it at all, so I guess it boils down to:

nix shell github:loophp/nix-shell#env-php82

or

nix shell github:loophp/nix-shell#env-php82 --impure

Right?

from nix-shell.

ostrolucky avatar ostrolucky commented on May 28, 2024

Behaviour for #*php* shells shouldn't be affected, only for #default. In that case yeah only when --impure flag is used it will read it from composer.json, otherwise it can keep the current default (php8.1)

from nix-shell.

drupol avatar drupol commented on May 28, 2024

That's actually a super cool idea ! I didn't think about that!!

Would you like to submit a PR ?

from nix-shell.

ostrolucky avatar ostrolucky commented on May 28, 2024

Yeah I'll see how I am with time but it should be doable in foreseeable future :)

from nix-shell.

drupol avatar drupol commented on May 28, 2024

Good, looking forward to it !

from nix-shell.

drupol avatar drupol commented on May 28, 2024

I updated the codebase these last days, implementing that feature should definitely be easy.

Basically it boils down to parsing the PHP version in composer.json and assigning it to the new defaultPhpVersion variable.

from nix-shell.

drupol avatar drupol commented on May 28, 2024

I found this regex to work pretty fine: https://regex101.com/r/NWCilZ/1

But since Nix is using C++ std::regex, which doesn't support most extensions, we need to rewrite it accordingly.

from nix-shell.

Related Issues (9)

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.