4 ms·
I use nix-shell for dev environments. Once I've got it working it's wonderful - full replicable, across multiple development machines and CI. It's painful thoug
by rkangel 5y ago
I use nix-shell for dev environments. Once I've got it working it's wonderful - full replicable, across multiple development machines and CI. It's painful though. Some problems I've encountered recently on different projects:
Old version of fwup packaged. Can override to get newer version, but needed to add another dependency to make tests pass (and it gets built locally rather than being cached)
Pain getting my environment to include the right Python packages so I can run the gigalixir command line tool.
Have to workaround an oddity to do with how Erlang is packaged so that I don't get lots of warnings when anything is compiled:
shellHook =
''
export ERL_LIBS=""
'';
- lpmay 5y agoJust a hint - extra attributes in the `mkShell` appear as environment variables in the built shell. So instead of a `shellHook` for this you can just have an attribute `ERL_LIBS="";` I'm not completely sure but I think this approach is preferred because shellHook only runs in `nix-shell` but if you ever wanted to `nix-build` a release it might not run.
- takeda 5y agoThere tools like direnv, that "enter" your env environment as soon as you cd to the directory. This is implemented by changing environment variables like PATH. Because shellHook allows on executing any code, there's no standardized way to undo what it executes, so those tools don't execute that part.