MyNixOS website logo
option

programs.github-copilot-cli.lspServers

LSP (Language Server Protocol) server configurations written to lsp-config.json inside programs.github-copilot-cli.configDir.

Each attribute defines a server entry under lspServers in the config file. Supported fields include:

  • command — command used to start the LSP server
  • args — arguments passed to the command
  • fileExtensions — map of file extensions to language IDs
  • env — environment variables for the server process
  • rootUri — server root directory relative to the Git root
  • initializationOptions — custom startup options
  • requestTimeoutMs — request timeout in milliseconds

Language server packages are not installed automatically. Add them to home.packages when needed.

See https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-lsp-servers for the documentation.

Declarations
Type
attribute set of (JSON value)
Default
{ }
Example
{
  typescript = {
    command = "typescript-language-server";
    args = [ "--stdio" ];
    fileExtensions = {
      ".ts" = "typescript";
      ".tsx" = "typescriptreact";
      ".js" = "javascript";
      ".jsx" = "javascriptreact";
    };
  };
  python = {
    command = lib.getExe' pkgs.pyright "pyright-langserver";
    args = [ "--stdio" ];
    fileExtensions = {
      ".py" = "python";
      ".pyw" = "python";
      ".pyi" = "python";
    };
  };
}