Add flag --print-path to nix print-dev-env, expose getDerivationEnvironment in libcmd#15665
Add flag --print-path to nix print-dev-env, expose getDerivationEnvironment in libcmd#15665lisanna-dettwyler wants to merge 3 commits into
--print-path to nix print-dev-env, expose getDerivationEnvironment in libcmd#15665Conversation
getDerivationEnvironment in libcmd--path to nix print-dev-env, expose getDerivationEnvironment in libcmd
|
@roberth what are the grammar conventions again for flags? |
roberth
left a comment
There was a problem hiding this comment.
I'm really not a fan of nix develop, because it's too coupled with nixpkgs and everything.
I think the right direction would be to make shell environment and shell runners part of package expressions instead of continuing to "derive" them from derivations.
Context:
This prints the store path of the shell environment rather than the contents. This enables garbage collection of dev shells, which are not directly instantiated. Signed-off-by: Lisanna Dettwyler <lisanna.dettwyler@gmail.com>
d29c079 to
c35216c
Compare
--path to nix print-dev-env, expose getDerivationEnvironment in libcmd--print-path to nix print-dev-env, expose getDerivationEnvironment in libcmd
Signed-off-by: Lisanna Dettwyler <lisanna.dettwyler@gmail.com>
Additionally adds a mostly stubbed libcmd-c library with just nix_libcmd_get_legacy_shell_derivation_environment exposed. Additional bindings will probably be upstreamed by the cachix team in the future. This function is useful for utilities like devenv to compute the same shell environment that `nix develop` does for a derivation. Signed-off-by: Lisanna Dettwyler <lisanna.dettwyler@gmail.com>
c35216c to
7846841
Compare
|
Note that there already is |
|
I agree with @roberth that |
This new flag prints the store path of the shell environment rather than the contents. Use this new flag to add a garbage collection example in store-delete.md.
Also expose
getDerivationEnvironmentin libcmd, and in a new stubbed libcmd-c asnix_libcmd_get_derivation_environment. Additional bindings will probably be upstreamed by the cachix team in the future.@domenkozar you should find this useful for devenv
Motivation
This new flag enables garbage collection of dev shells, which are not directly instantiated.
getDerivationEnvironmentis useful for utilities like devenv to compute the same shell environment thatnix developdoes for a derivation.Context
#15236
#7239
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.