From fa5d2bcc766513112a1a7fc439886f6b2225f7d5 Mon Sep 17 00:00:00 2001 From: Giulio De Pasquale Date: Wed, 21 Feb 2024 15:13:20 +0000 Subject: [PATCH] helix: switch to pyright and ruff-lsp --- roles/home/helix.nix | 49 +++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 16 deletions(-) diff --git a/roles/home/helix.nix b/roles/home/helix.nix index 53d96ad..e286b41 100644 --- a/roles/home/helix.nix +++ b/roles/home/helix.nix @@ -1,21 +1,41 @@ { pkgs, ... }: let - pythonPkgs = with pkgs.python3Packages; [ + actualPkgs = pkgs.unstablePkgs; + + pythonPkgs = with actualPkgs.python3Packages; [ python-lsp-server python-lsp-ruff + pylsp-mypy ]; - nodePkgs = with pkgs.nodePackages; [ + nodePkgs = with actualPkgs.nodePackages; [ vscode-langservers-extracted typescript svelte-language-server yaml-language-server typescript-language-server bash-language-server + pyright ]; in { home = { + packages = with actualPkgs; [ + black + helix + clang-tools + rust-analyzer + nil + texlab + nixpkgs-fmt + ruff + ruff-lsp + mypy + shellcheck + shfmt + gopls + # ] ++ pythonPkgs ++ nodePkgs; + ] ++ nodePkgs; sessionVariables = { EDITOR = "hx"; VISUAL = "hx"; @@ -53,25 +73,22 @@ in [[language]] name = "python" formatter = { command = "black", args = [ "-" ] } + language-servers = [ {name = "pyright"}, {name = "ruff-lsp"}, ] + + [language-server.pyright] + command = "pyright-langserver" + args = ["--stdio"] + config = {} + [language-server.ruff-lsp] + command = "ruff-lsp" + args = [] + config = {} + [[language]] name = "bash" indent = { tab-width = 2, unit = " " } formatter = { command = 'shfmt', args = ["-i", "2"] } ''; - - packages = with pkgs.unstablePkgs; [ - black - helix - clang-tools - rust-analyzer - nil - texlab - nixpkgs-fmt - ruff - shellcheck - shfmt - gopls - ] ++ pythonPkgs ++ nodePkgs; }; }