From 87aeb4cfead1af97c6fb80ada011123c58656f74 Mon Sep 17 00:00:00 2001 From: Bad Date: Fri, 26 Aug 2022 22:55:16 +0200 Subject: [PATCH] Enable go-lsp --- users/modules/neovim/default.nix | 4 ++++ users/modules/neovim/go.nix | 19 +++++++++++++++++++ users/profiles/neovim/default.nix | 1 + 3 files changed, 24 insertions(+) create mode 100644 users/modules/neovim/go.nix diff --git a/users/modules/neovim/default.nix b/users/modules/neovim/default.nix index 6d2b848..72b35d1 100644 --- a/users/modules/neovim/default.nix +++ b/users/modules/neovim/default.nix @@ -7,6 +7,7 @@ in imports = [ ./nvim-lsp.nix ./js.nix + ./go.nix ./rust.nix ./nix.nix ]; @@ -30,6 +31,9 @@ in vim-sleuth ]; + extraPackages = with pkgs; [ + nodePackages.prettier + ]; extraConfig = '' set background=dark set termguicolors diff --git a/users/modules/neovim/go.nix b/users/modules/neovim/go.nix new file mode 100644 index 0000000..a67ff66 --- /dev/null +++ b/users/modules/neovim/go.nix @@ -0,0 +1,19 @@ +{ lib, pkgs, config, ... }: +let + cfg = config.mae.nvim.go; +in +with lib; +{ + options.mae.nvim.go.enable = lib.mkEnableOption "Enable go language support in neovim"; + + config = mkIf cfg.enable { + mae.nvim.lsp.servers.gopls = { + enable = true; + script = '' + { + cmd = { "${pkgs.gopls}/bin/gopls" }, + } + ''; + }; + }; +} diff --git a/users/profiles/neovim/default.nix b/users/profiles/neovim/default.nix index 7bfde99..a7bdbef 100644 --- a/users/profiles/neovim/default.nix +++ b/users/profiles/neovim/default.nix @@ -7,6 +7,7 @@ js.deno.enable = true; nix.enable = true; rust.enable = true; + go.enable = true; #clangd.enable = true; #python.enable = true; };