From e391a8d3104555415c6587c069b7eadc3546cf54 Mon Sep 17 00:00:00 2001 From: Bad Date: Sat, 3 Sep 2022 18:00:46 +0200 Subject: [PATCH] Add pyright lsp --- flake.lock | 18 +++++++++--------- users/modules/neovim/default.nix | 1 + users/modules/neovim/python.nix | 19 +++++++++++++++++++ users/profiles/neovim/default.nix | 2 +- 4 files changed, 30 insertions(+), 10 deletions(-) create mode 100644 users/modules/neovim/python.nix diff --git a/flake.lock b/flake.lock index 70b675d..bbe695d 100644 --- a/flake.lock +++ b/flake.lock @@ -169,11 +169,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1662101031, - "narHash": "sha256-dTlT6J6+Rv6zno/VhJusBwgV7iFNRUdY4GgH7BUPWYk=", + "lastModified": 1662186434, + "narHash": "sha256-N867s0Z20q9LNirVftWoKAmkEARmmHXZHyRTEmekf94=", "owner": "nix-community", "repo": "fenix", - "rev": "42e17909b3c69577303fd0c7ae138df3f4888de2", + "rev": "e228867146581fa5e4be25dafc0dd68fdd22f0ad", "type": "github" }, "original": { @@ -400,11 +400,11 @@ ] }, "locked": { - "lastModified": 1659610603, - "narHash": "sha256-LYgASYSPYo7O71WfeUOaEUzYfzuXm8c8eavJcel+pfI=", + "lastModified": 1662136632, + "narHash": "sha256-RwW/aA3ueQPsilQLi7NOfUnn8MgM6WMV+oRpW+nkDMI=", "owner": "nmattia", "repo": "naersk", - "rev": "c6a45e4277fa58abd524681466d3450f896dc094", + "rev": "8d2f4d00cb24cda8e5bdd802b827a0eaeff34eec", "type": "github" }, "original": { @@ -415,11 +415,11 @@ }, "nixos": { "locked": { - "lastModified": 1662025319, - "narHash": "sha256-ZJlBQ7jXynq4+Jg9+DgOe8FJG8sDIeFFYP3V3K98KUs=", + "lastModified": 1662099760, + "narHash": "sha256-MdZLCTJPeHi/9fg6R9fiunyDwP3XHJqDd51zWWz9px0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "b82ccafb54163ab9024e893e578d840577785fea", + "rev": "67e45078141102f45eff1589a831aeaa3182b41e", "type": "github" }, "original": { diff --git a/users/modules/neovim/default.nix b/users/modules/neovim/default.nix index 753b91f..cbf6b5b 100644 --- a/users/modules/neovim/default.nix +++ b/users/modules/neovim/default.nix @@ -10,6 +10,7 @@ in ./go.nix ./rust.nix ./nix.nix + ./python.nix ./clangd.nix ]; diff --git a/users/modules/neovim/python.nix b/users/modules/neovim/python.nix new file mode 100644 index 0000000..ad511d6 --- /dev/null +++ b/users/modules/neovim/python.nix @@ -0,0 +1,19 @@ +{ lib, pkgs, config, ... }: +let + cfg = config.mae.nvim.python; +in +with lib; +{ + options.mae.nvim.python.enable = lib.mkEnableOption "Enable python language support in neovim"; + + config = mkIf cfg.enable { + mae.nvim.lsp.servers.pyright = { + enable = true; + script = '' + { + cmd = { "${pkgs.nodePackages.pyright}/bin/pyright-langserver", "--stdio" }, + } + ''; + }; + }; +} diff --git a/users/profiles/neovim/default.nix b/users/profiles/neovim/default.nix index 4cf3cb5..4ed8581 100644 --- a/users/profiles/neovim/default.nix +++ b/users/profiles/neovim/default.nix @@ -9,6 +9,6 @@ rust.enable = true; go.enable = true; clangd.enable = true; - #python.enable = true; + python.enable = true; }; }