Comments (9)
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.
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.
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.
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.
That's actually a super cool idea ! I didn't think about that!!
Would you like to submit a PR ?
from nix-shell.
Yeah I'll see how I am with time but it should be doable in foreseeable future :)
from nix-shell.
Good, looking forward to it !
from nix-shell.
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.
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)
- Dependency Dashboard
- nix shell in README should be replaced with nix develop HOT 7
- defaultExtensions are way too fat, resulting in long installation times HOT 19
- Can't use nix-shell.api.makePhp to build a devShell with php5.6 HOT 4
- Importing extensions from composer.json/lock does not work anymore while building a devShell HOT 3
- Error while launching nix shell : The foobar extension does not exist, ignoring. HOT 3
- Grep version from busybox issue with OhMyZsh grep-alias cache HOT 3
- Nix experimental features HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nix-shell.