Hacker News new | ask | show | jobs
by __MatrixMan__ 390 days ago
For each project, configure a nix devshell to include the appropriate linters etc for that project. Then configure direnv to activate the nix devshell when you cd into the project directory. Then launch your editor from that shell. Since the editor's parent process is the devshell, its PATH var points to that project's dependencies.

Or at least that's how I do it. That will make `ruff` or `pyright-langserver` point to whichever version of the tool is bound to that project. So when I run `nix flake update` it updates the tools for only that project and I don't get any crosstalk between projects.

As for whether a given linter or language server should be configured for that project, helix looks for .helix/languages.toml in the CWD to decide which ones to load, so that bit of config I handle independently from nix, I just add that file to the repo. Presumably emacs has something similar.

So to answer your question: you only get a project-specific version of emacs if you add emacs to the project's devshell. Otherwise whatever was already on your PATH will be used.