nix-community / lorri

Your project’s nix-env [maintainer=@Profpatsch,@nyarly]
Apache License 2.0
638 stars 24 forks source link

feature request: Use lorri with `buildFHSUserEnv` #70

Open naripok opened 2 years ago

naripok commented 2 years ago

Feature description That is more a question than a request, but a request if not supported.

I would like lorri to enter my buildFHSUserEnv environments as it does with mkShell. Is that possible? It seems to work well with all my mkShell shells, but for my python projects in which I use buildFHSUserEnv, lorri just enters the directory and drop me in a regular shell without any packages or modifications. I've found this guy on reddit with the same problem and no solutions.

Target users Python developers who need to use pipenv or virtualenv and packages with compiled binaries that expects FHS file-system.

GaetanLepage commented 2 years ago

I agree, this would be great !

JensAc commented 8 months ago

Did anyone find a solution for that in the meantime. I am facing exactly the same issue and would really appreciate any help :slightly_smiling_face: .

nyarly commented 8 months ago

I can see the appeal, but as I understand it, buildFHSUserEnv relies on containerization to do its thing, right? I'd be happy to work through some design for this but the issue I see is that Lorri primarily works with Direnv to do its thing, which sets environment variables in the running shell.

There are Lorri sub-commands that also run a shell, which might be able to be adapted to work with a containerized shell, but at that point you don't get a huge benefit over just using nix-shell.

(Sadly, the reddit post has been deleted.)

So I guess my question is: what are you hoping to have Lorri do with buildFHSUserEnv?

JensAc commented 8 months ago

Thanks for the response. I am sorry, but I do not know how buildFHSUserEnv works internally, but I can explain my use-case.

I want to use Python virtual environments for development and with respect to the NixOS Wiki this is achieved by using buildFHSUserEnv. Moreover, you might need to set some environment Variables as explained here (I know, this example uses pkgs.mkshell, but it also works with buildFHSUserEnv). This use-case can already be realized by just calling nix-shell working in this dev-shell. However, it would be great if Emacs could jump automatically in such a shell using direnv-mode, when working on a python project.

I think, I could also just workaround all of that by starting Emacs in the dev-shell, but this does not feel comfortable. Nevertheless, if it is not a simple switch to turn for making buildFHSUserEnv work with Lorri, I would say that it is most probably not worth the effort.