So i have two binaries pointing to the same command. But i just want this (/nix/store/l7ncb0skqzy12kqy3phr3812cywzw0j0-ghc-9.0.1-with-packages/bin/ghcide). How can i hide the later inside a nix shell?
Binaries in PATH inside the shell will usually take precedence over the binaries outside. If you want to clear the outside environment including PATH to be absolutely sure, use the --pure flag.
Actually the problem was on my mkShell. I was trying to use pkgs.haskell.packages.ghc901 with pkgs.haskellPackages.haskell-language-server. The fix was replace the with pkgs.haskellPackages for with pkgs.haskell.packages.ghc901
--ignore-environment / -i, not possible to set declaratively, since derivations aren’t really concerning themselves with development environment, so handling such things there would be a layer violation, imo. mkShell is basically just a hack to create fake derivations that can act as a development environment easily.