mirror of
https://github.com/nix-community/nixvim.git
synced 2025-07-30 23:55:15 +02:00
plugins/lsp: modernize implem of language-servers
This commit is contained in:
parent
57464f22bb
commit
e6018ac195
12 changed files with 618 additions and 598 deletions
|
@ -4,24 +4,24 @@
|
|||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.plugins.lsp.servers.hls;
|
||||
inherit (lib) types;
|
||||
in
|
||||
{
|
||||
options.plugins.lsp.servers.hls = {
|
||||
installGhc = mkOption {
|
||||
installGhc = lib.mkOption {
|
||||
type = with types; nullOr bool;
|
||||
default = null;
|
||||
example = true;
|
||||
description = "Whether to install `ghc`.";
|
||||
};
|
||||
|
||||
ghcPackage = mkPackageOption pkgs "ghc" { };
|
||||
ghcPackage = lib.mkPackageOption pkgs "ghc" { };
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
warnings = optional (cfg.installGhc == null) ''
|
||||
config = lib.mkIf cfg.enable {
|
||||
warnings = lib.optional (cfg.installGhc == null) ''
|
||||
`hls` relies on `ghc` (the Glasgow Haskell Compiler).
|
||||
- Set `plugins.lsp.servers.hls.installGhc = true` to install it automatically with Nixvim.
|
||||
You can customize which package to install by changing `plugins.lsp.servers.hls.ghcPackage`.
|
||||
|
@ -29,6 +29,6 @@ in
|
|||
By doing so, you will dismiss this warning.
|
||||
'';
|
||||
|
||||
extraPackages = with pkgs; (optional ((isBool cfg.installGhc) && cfg.installGhc) cfg.ghcPackage);
|
||||
extraPackages = lib.optional ((lib.isBool cfg.installGhc) && cfg.installGhc) cfg.ghcPackage;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue