mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-20 16:15:43 +02:00
Some checks are pending
Publish every Git push to main to FlakeHub / flakehub-publish (push) Waiting to run
Publish every git push to Flakestry / publish-flake (push) Waiting to run
Documentation / Build unstable (push) Waiting to run
Documentation / Build 24.11 (push) Waiting to run
Documentation / Build 25.05 (push) Waiting to run
Documentation / Combine builds (push) Blocked by required conditions
Documentation / Deploy (push) Blocked by required conditions
https://github.com/nix-community/nixvim/pull/3445#pullrequestreview-2908615597
40 lines
1.2 KiB
Nix
40 lines
1.2 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
cfg = config.plugins.lsp.servers.hls;
|
|
inherit (lib) types;
|
|
|
|
ghcPackage = lib.optional (cfg.installGhc == true) cfg.ghcPackage;
|
|
in
|
|
{
|
|
options.plugins.lsp.servers.hls = {
|
|
installGhc = lib.mkOption {
|
|
type = with types; nullOr bool;
|
|
default = null;
|
|
example = true;
|
|
description = "Whether to install `ghc`.";
|
|
};
|
|
|
|
ghcPackage = lib.mkPackageOption pkgs "ghc" { };
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
warnings = lib.nixvim.mkWarnings "plugins.lsp.servers.hls" {
|
|
when = cfg.installGhc == null;
|
|
message = ''
|
|
`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`.
|
|
- Set `plugins.lsp.servers.hls.installGhc = false` to not have it install through Nixvim.
|
|
By doing so, you will dismiss this warning.
|
|
'';
|
|
};
|
|
|
|
extraPackages = lib.optionals (!cfg.packageFallback) ghcPackage;
|
|
extraPackagesAfter = lib.optionals cfg.packageFallback ghcPackage;
|
|
};
|
|
}
|