{ pkgs, ... }:
{
  home.packages = with pkgs; [
    go
    delve
    gopls
  ];
  programs.nixvim.plugins.lsp.servers.gopls = {
    enable = true;
    rootDir = ''
      require 'lspconfig.util'.root_pattern('.git', 'go.mod', 'go.work')
    '';
    extraOptions = {
      settings = {
        gopls = {
          analyses = {
            unusedparams = true;
          };
          staticcheck = true;
        };
      };
    };
  };
}