mason-org / mason-org/mason.nvim

Add Global with_paths Setting Support

Open
#2,014 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Lua
Stars
10.5k
Forks
338
PR merge metrics
No merged PRs in 30d

Description

### I've searched open issues for similar requests

- [x] Yes

### Is your feature request related to a problem? Please describe.

I use Nix to build my development environment and prefer to keep it as clean as possible. However, mason.nvim requires installers to be available in the global scope, which conflicts with my isolated environment setup.

### Describe the solution you'd like

Add support for a global with_paths configuration option that allows users to specify additional PATH environment variables when mason.nvim spawns installer processes during package installation.

### Describe potential alternatives you've considered

I implemented this feature 3 weeks ago and it has been working well in my build. Below are code snippets from my Neovim setup that demonstrate the configuration.

#### Nix Configuration

```nix
{
"${config_root}/lua/config/nixpkgs-passthrough.lua" = let
masonPackages = with pkgs; [
go
cargo
nodejs
python3
];
masonPaths = lib.strings.concatStringsSep ",\n " (map (pkg: ''"${pkg}/bin"'') masonPackages);
in {
text = ''
vim.g.mason_with_paths = {${masonPaths}}
'';
};
}
```

#### Lua Plugin Configuration

```lua
return {
"mason-org/mason.nvim",
url = "https://github.com/linw1995/mason.nvim.git",
opts = {
with_paths = vim.g.mason_with_paths or {},
},
}
```

This implementation dynamically generates the required paths from Nix packages and makes them available to mason.nvim through the with_paths configuration option.
Thank you for considering this feature request!

### Additional context

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing mason.nvim's installer process spawning and configuration handling for the proposed global with_paths option. Compare the supplied Nix and Lua configuration examples with the existing configuration flow, then verify that configured paths are available to installer processes during package installation.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, neovim
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.