-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Print version information when entering shell #739
Comments
'devenv info' already lists the package names, which contain the version strings already, without needing to execute binaries. |
Hm, interesting. Unfortunately, it's not available when using flakes (but I'm guessing that's an easy fix). :/ Also, not all packages may be important. For example, when I'm working on a Go/Kubernetes project, I'm mostly interested in those tools, but not the version of curl or jq being used. |
Any ideas how to expose |
You don't necessarily need to do that, you can just solve it within the devenv NixOS module itself, with something like this: enterShell =
"${lib.concatMapStringsSep "\n" (pkg: ''
echo "${pkg.pname}: ${if pkg ? "version" then pkg.version else "unknown"}"
'') (builtins.filter (pkg: pkg ? "pname" && builtins.elem pkg.pname ["terraform" "ngrok"]) config.packages)}"; Produces:
|
Thanks @thenonameguy Looking at |
It should be available at |
@domenkozar thanks! I tried that, but similarly to #711, it doesn't seem to work. |
Today I got an idea how we could support flakes in a better way. Will create a prototype in a few days. |
Sounds good! Happy to test-drive it once you have something cooked up. |
One thing I like doing is print version information when entering the shell of a new/different project. It tells me what tools I get for the project.
However, writing the version script over and over again results in a lot of duplications.
I propose adding a module that prints version information for already supported tools (eg. languages) and allows users to opt-in for displaying version information when entering a devshell.
Here is what I cooked up:
In case of Go, the integration would look like this:
Would you be interested in adding such a module?
The text was updated successfully, but these errors were encountered: