Language Selection Option for `devenv init`
When setting up a new devenv environment for a random project that I am cloning, I would love to speed up the process by being able to select a language. Either via a terminal user interface menu or an argument. For example, choose Python, JavaScript, TypeScript, Rust and make the devenv.nix have those languages enabled.
In the current process, I enter devenv init and it already starts downloading and initializing quite some stuff. Then, if I manually edit the file and enable some languages, I would have to wait twice.
Combining language selection and initialization speeds up the development process, and I think would fit with the project in general. In this sense, the templating could be opinionated with enabling pre-commit hooks or other options. It could also be opinionated by default and configurable as well via a menu.
This sounds very similar to the devenv generate feature that was introduced a while ago. I am also working on devenv init --template in https://github.com/cachix/devenv/pull/1721. Does that solve your use case?
Both templates and generate looks great!
Personally, I like to spend as little time as possible initially setting up my env. While keeping the long-term benefits from devenv, such as composability and reproducibility.
When I have new inspiration, I for example want to set up a project with:
- Python FastAPI, React front-end
- Rust Backend, React frontend
- Full-stack NextJS or Remix ...
There are many options within devenv. Like do you want JS or TS? do you want npm, yarn, pnpm? which python version? which python bundler? I do think for new projects it is nice to be opinionated and go for pnpm for the extra speed. Same with Python and uv. So a good init flow helps you through this process.
Having a command that gives you the correct config file saves you a lot of time, as devenv init takes 33s for me (I think this used to be slower when I created this github issue). Then I have to spend maybe 10 minutes going through the documentation for the right options. Afterwards you have to wait for the dependencies to download and install.
Personally, devenv generate with the AI looks like a good solution, and devenv init --template would also be good given there is a list of opinionated templates. Templates could be slightly better than AI I think, since LLM models might not be up-to-date with the latest dev news. But you could use AI to make templates ;). Like devenv.new: "Python FastAPI, React front-end. Use UV and PNPM"
I wonder if anyone finds this useful, given that https://devenv.new exists