Mic92 / envfs

Fuse filesystem that returns symlinks to executables based on the PATH of the requesting process.
247 stars 5 forks source link

Could this project make the default PATH usable? #139

Closed purkhusid closed 10 months ago

purkhusid commented 10 months ago

I'm curious if this project could somehow make the default PATH work like it does on FHS systems? My exact issue is that I'm using Bazel to build projects and Bazel executes commands where the PATH is not set.

On a normal FHS system the default PATH would be used which would be something like /usr/local/bin:/usr/bin but on NixOS the default PATH is set to /no-such-path.

If this does not fit into the scope of this project then feel free to close the issue!

Mic92 commented 10 months ago

If only the default PATH is set than the filesystem will not work because it relies on PATH to point to something else but itself to find binaries which are than returned as symlinks.

purkhusid commented 10 months ago

Do you have any ideas how one might replace the default PATH that is set in bash and bashInteractive ?

Mic92 commented 10 months ago

This bash override should do the job: (bash.override { forFHSEnv = true; })

Mic92 commented 10 months ago

Or you can use overrideAttrs to set some other value: https://github.com/NixOS/nixpkgs/blob/c13348cde75b1aff57d6fd32277a74296a115320/pkgs/shells/bash/5.nix#L47