Skip to content
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

Direnv is extremely verbose #79

Closed
madjar opened this issue Nov 18, 2022 · 4 comments · Fixed by #105 or #191
Closed

Direnv is extremely verbose #79

madjar opened this issue Nov 18, 2022 · 4 comments · Fixed by #105 or #191

Comments

@madjar
Copy link
Contributor

madjar commented Nov 18, 2022

Disclaimer: this boils down to a direnv and print-dev-env issue, but it still relevant to the UX of devenv.

Running direnv allow after running devenv init, on top of the normal output of devenv, we get something like:

direnv: export +AR +AS +CC +CONFIG_SHELL +CXX +DETERMINISTIC_BUILD +DEVENV_DOTFILE +DEVENV_ROOT +DEVENV_STATE +GREET +HOST_PATH +IN_NIX_SHELL +LD +NIX_BINTOOLS +NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_BUILD_CORES +NIX_BUILD_TOP +NIX_CC +NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_CFLAGS_COMPILE +NIX_ENFORCE_NO_NATIVE +NIX_HARDENING_ENABLE +NIX_INDENT_MAKE +NIX_LDFLAGS +NIX_STORE +NM +OBJCOPY +OBJDUMP +PYTHONHASHSEED +PYTHONNOUSERSITE +PYTHONPATH +RANLIB +READELF +SIZE +SOURCE_DATE_EPOCH +STRINGS +STRIP +TEMP +TEMPDIR +TMP +TMPDIR +_PYTHON_HOST_PLATFORM +_PYTHON_SYSCONFIGDATA_NAME +buildInputs +buildPhase +builder +cmakeFlags +configureFlags +depsBuildBuild +depsBuildBuildPropagated +depsBuildTarget +depsBuildTargetPropagated +depsHostHost +depsHostHostPropagated +depsTargetTarget +depsTargetTargetPropagated +doCheck +doInstallCheck +dontAddDisableDepTrack +mesonFlags +name +nativeBuildInputs +out +outputs +patches +phases +propagatedBuildInputs +propagatedNativeBuildInputs +shell +shellHook +stdenv +strictDeps +system ~PATH ~XDG_DATA_DIRS

This is very noisy, not very useful, and gives a bad impression.


In the end, this is because nix-shell (and nix develop and nix print-dev-env) is designed to "provide the build environment of a derivation", not making shell environments that don't build a derivation.

devshell fixes that by reimplementing mkShell in a way that removes everything that we don't want (doesn't use mkDerivation, and does additional cleanup): https://github.com/numtide/devshell/blob/master/nix/mkNakedShell.nix.

@thenonameguy
Copy link
Contributor

thenonameguy commented Nov 19, 2022

I started development on this branch:
https://github.com/thenonameguy/devenv/tree/naked-shell
The profile abstraction doesn't completely make sense in the context of this project, that has to be reworked.
I included the code from a fork of devshell that has an inputDerivation passthru attribute.
This would allow to trivially implement a devenv cachix-push command that pushes up the CI dependencies.

@domenkozar
Copy link
Member

That's really cool @thenonameguy, will you make a PR so we can do some testing?

@thenonameguy
Copy link
Contributor

That's really cool @thenonameguy, will you make a PR so we can do some testing?

That's the plan, will hopefully get to it in the evening. 🙏

@thenonameguy
Copy link
Contributor

@domenkozar please reopen until the revert PR with a solution is found to the issue.
RFC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants