# Flake-based dev shells with nix-direnv: library problems

**URL:** https://discourse.nixos.org/t/flake-based-dev-shells-with-nix-direnv-library-problems/21738
**Category:** Uncategorized
**Created:** [September 16, 2022, 8:31am UTC](https://discourse.nixos.org/t/flake-based-dev-shells-with-nix-direnv-library-problems/21738 "2022-09-16T08:31:17Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ppenguin](https://discourse.nixos.org/user_avatar/discourse.nixos.org/ppenguin/32/3583_2.png) [@ppenguin](https://discourse.nixos.org/u/ppenguin)
#### Post date: [September 16, 2022, 8:31am UTC](https://discourse.nixos.org/t/flake-based-dev-shells-with-nix-direnv-library-problems/21738/1 "2022-09-16T08:31:17Z")

</div>

I’m in the process of moving my generic dev shells to a public repo with the purpose to make it trivial to enter a certain (impure) dev env.

However, I’m struggling to get it working.

Taking as an example the following `.envrc`:

```auto
use flake github:ppenguin/nixenvs#dev-ansible --impure

```

yields

```auto
> cd test-direnv
direnv: loading ~/devel/github.com/ppenguin/nixenvs/test-direnv/.envrc
direnv: using flake github:ppenguin/nixenvs#dev-ansible --impure
direnv: nix-direnv: using cached dev shell
/nix/store/p643r4aczmzb0dhyrx3dj592f0s5v7xj-coreutils-9.0/bin/dircolors: error while loading shared libraries: __vdso_time: invalid mode for dlopen(): Invalid argument
/nix/store/29zfzn3jzx04xqlpp3wzf7gzvvmdcw62-gnupg-2.3.6/bin/gpg-connect-agent: error while loading shared libraries: __vdso_gettimeofday: invalid mode for dlopen(): Invalid argument
***stack smashing detected*** : terminated

```

I understand that this must be caused by incompatibilities in my inherited shell (`zsh`) env and the instantiated nix dev env. (I.e. features from e.g. `oh-my-zsh` referring to basic libs (`glibc`?) in my “home env” which are apparently overridden by the dev env.

However, I was expecting that being impure should take care of this?  
Impurity is a requirement anyway, because the objective is to use these shells in my existing HM-based config (or other user’s non-nixos-based env) which has `vscode` with plugins installed to be used in conjunction, and via `direnv`.

So what I want to achieve is dev (and run) envs in a remote public repo that are “superimposed” on the normal user-environment, and that I can execute via `.envrc`.

[Here’s my current experimental status](https://github.com/ppenguin/nixenvs), which is unsatisfactory because it doesn’t work with `direnv` and if used via `nix develop <flake-attribute>` it drops me in a `bash` and not in an “augmented” user shell (`zsh` in my case).

If I call the shell directly from `.envrc`, e.g. [like here](https://github.com/ppenguin/nixenvs/blob/1c121479105359ed2a48641fcc3b0d3d3ea06ebf/test-direnv/ansible-direct/.envrc) it works as intended.
