emacs-lsp / lsp-haskell

lsp-mode :heart: haskell
https://emacs-lsp.github.io/lsp-haskell
GNU General Public License v3.0
236 stars 62 forks source link

make Nix env wrapper suggestion a total solution #88

Closed Anton-Latukha closed 3 years ago

Anton-Latukha commented 3 years ago

The prior code is a partial solution, shell.nix is not required to exist, default.nix can be used instead, and even with looking only in Haskell project root dir - the relevant {default,shell}.nix can be found arbitrary number of the levels up the filesystem hierarchy (practical limit is Git the repo).

The default standardized nix-shell behavior and expectation is that if shell.nix not found - nix-shell loads default.nix (which, if exists - is always possible, since default.nix describes package derivation, and package derivation always can be loaded as shell environment by Nix), so there are a number of projects that do not have shell.nix, but, expect default.nix to be used instead.

And then there is are projects where shell.nix or default.nix can be in ../ or up the tree - there is a subset of the project with those types of quirks, for example, Target company Nix configurations promote that approach. This all (for all intents and purposes - all) cases is solved by using a well-supported/used library function from the https://github.com/travisbhartwell/nix-emacs, package nix-sandbox, function nix-current-sandbox - "searches for a sandbox file starting from the current working directory".

Anton-Latukha commented 3 years ago

Ok, I see there is no interest in this.

Fair enough.