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

feat(shell): add option to turn off naked shell implementation, disable for C compiler using languages #498

Closed

Conversation

thenonameguy
Copy link
Contributor

fixes #497

@domenkozar
Copy link
Member

I understand the motivation for this, but I'm leaning towards not having an option for this. We should pick one way and make it work.

Is there no way to activate setup-hooks that we consider important from stdenv with the naked shell approach?

Otherwise we better just use plain stdenv in all the cases :(

@thenonameguy
Copy link
Contributor Author

thenonameguy commented Mar 17, 2023

Yup, makes sense, keeping cyclomatic complexity low is a great guide.

This branch was created to unblock my friend using devenv on M1 for a Rust project, therefore it is more on the fast implementation, than a well thought one :)

{ pkgs, lib, ... }:

{
  packages = [
    pkgs.git
  ]
  ++ lib.optionals pkgs.stdenv.isDarwin (with pkgs.darwin.apple_sdk; [
    frameworks.Security
  ]);

  languages.rust.enable = true;
}

It solved the problem for him, but of course we are back to square with the:

direnv: export +AR +AS +CC +CFLAGS +CONFIG_SHELL +CXX +DEVENV_DOTFILE +DEVENV_PROFILE +DEVENV_ROOT +DEVENV_STATE +HOST_PATH +IN_NIX_SHELL +LD +LD_DYLD_PATH +MACOSX_DEPLOYMENT_TARGET +NIX_BINTOOLS +NIX_BINTOOLS_WRAPPER_TARGET_HOST_aarch64_apple_darwin +NIX_BUILD_CORES +NIX_CC +NIX_CC_WRAPPER_TARGET_HOST_aarch64_apple_darwin +NIX_CFLAGS_COMPILE +NIX_COREFOUNDATION_RPATH +NIX_DONT_SET_RPATH +NIX_DONT_SET_RPATH_FOR_BUILD +NIX_ENFORCE_NO_NATIVE +NIX_HARDENING_ENABLE +NIX_IGNORE_LD_THROUGH_GCC +NIX_LDFLAGS +NIX_NO_SELF_RPATH +NIX_STORE +NM +PATH_LOCALE +RANLIB +RUSTDOCFLAGS +RUSTFLAGS +RUST_SRC_PATH +SIZE +SOURCE_DATE_EPOCH +STRINGS +STRIP +XDG_DATA_DIRS +__darwinAllowLocalNetworking +__impureHostDeps +__propagatedImpureHostDeps +__propagatedSandboxProfile +__sandboxProfile +__structuredAttrs +buildInputs +buildPhase +builder +cmakeFlags +configureFlags +depsBuildBuild +depsBuildBuildPropagated +depsBuildTarget +depsBuildTargetPropagated +depsHostHost +depsHostHostPropagated +depsTargetTarget +depsTargetTargetPropagated +doCheck +doInstallCheck +dontAddDisableDepTrack +mesonFlags +name +nativeBuildInputs +out +outputs +patches +phases +preferLocalBuild +propagatedBuildInputs +propagatedNativeBuildInputs +shell +shellHook +stdenv +strictDeps +system ~PATH

env var export list. I'll try the selective setup-hook running / language module approach over the weekend to find a better middle-ground.

@thenonameguy
Copy link
Contributor Author

@domenkozar I tried implementing a change to naked shell, that runs the preConfigureHooks of the normal nix stdenv. Sadly couldn't get it to work. As an alternative, we could switch back to the pkgs.mkShell implementation and have a module configurable blocklist of unset env vars that we don't need.

@domenkozar
Copy link
Member

Sounds good to me, that will reduce a lot of the complexities we're currently facing.

@thenonameguy
Copy link
Contributor Author

Closing in favor of #507

@thenonameguy thenonameguy deleted the feat/turn-off-naked-shell branch April 3, 2023 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set subset of setup-hook provided env vars automatically, like NIX_CFLAGS_COMPILE
2 participants