Pure environment
How do I use lorri to obtain a pure environment in the nix-shell sense?
We don’t support that yet, but it’s a good feature request.
We deprecated lorri shell and are focusing on direnv (which does the environment setup), so I guess you’d have to integrate it with direnv, or clean the environment at the beginning of your .envrc.
I’d tentatively close this for now and recommend that one just runs nix-shell --pure manually if that’s a required use-case.
are there any particular reason why this should be closed? Is it because it would be difficult to implement or is it because its trivial to "clean the environment at the beginning of your .envrc"? If the latter then maybe that should be documented in then Readme? Personally I'd love to be able to use lorr's features with a pure shell sometimes.
Personally I'd love to be able to use lorr's features with a pure shell sometimes.
What’s your exact use-case there? Mostly to unset everything in the environment?
I’d tentatively close this for now and recommend that one just runs
nix-shell --puremanually if that’s a required use-case.
But what about re-usage cached shell in way that lorri does?
Is it possible to re-use same shell like lorri currently does -- in editor, and in --pure way, but without re-calculation on each access -- in the terminal, as work shell itself?
@curiousleo can we do that with the revived lorri shell?
lorri shell does not currently support --pure. I'm not sure at the moment how difficult it would be to add it.
This would be really nice. I try to keep a clean dev environment and an option for running with nix-shell --pure automatically would help.
I'm not sure at the moment how difficult it would be to add it.
Pretty sure it’s just cleaning out the environment before loading the bash --rcfile as described by
https://github.com/target/lorri/blob/200f4a2b5b1bbf9a2dd8c9b51c2cb907c7aebab3/src/ops/shell.rs#L28-L36
For what it's worth, my use case is reproducible scientific research. Means I'd like to keep the development environments for certain projects hermetic.