-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
mkShell
alternative that doesn't include stdenv, for use with direnv
or impure nix develop
#147060
Comments
You still want to run the setup hooks though? Those do rely on stdenv. |
I'm not certain which packages rely on them and which don't. I'm not pulling in compilers. I am doing things like I suppose what I really care about here is just ensuring the |
If you can work without the shell hooks, there is already
Otherwise, unsetting of unwanted paths can be done in the |
Using I actually do have a Having something in nixpkgs that did this officially would feel a lot more reliable. And this also feels like something that should be generally useful for others. |
#132617 this PR adds a shell that only relies on bash. |
Interesting. That looks like it does something very similar to what I want. It does mean I can't trivially pull in The |
Problem you want to solve
I want to use
direnv
(usingnix print-dev-env
) ornix develop
(ornix-shell
even) to give me an environment with a set of packages but I don't want to pull in anything from stdenv (unless I requested it). As it is, usingmkShellNoCC
on my system includesbashInteractive
,coreutils
,findutils
,diffutils
,gnused
,gnugrep
,gawk
,gnutar
,gzip
,bzip2
,gnumake
,bash
,patch
, andxz
, all in addition to the packages I requested.Using a shell to reproduce the build environment of an existing package should include all this, but when I'm using
mkShell
it's because I want to add specific dependencies to my existing environment. A pure shell probably needs stdenv, but it just gets in the way with my impure shell.The fundamental problem here is that
mkShell
/mkShellNoCC
depends onstdenv
, and so tools likenix print-dev-env
pull in all of the stdenv packages too.Proposed solution
Add a new library function that acts like
mkShell
except it produces a derivation that itself does not depend on stdenv.nix develop
should only add the packages that are listed explicitly.If possible, it should consider doing this only for "impure" shells, and still pull in stdenv for "pure" shells.
The text was updated successfully, but these errors were encountered: