mirror of
https://github.com/nix-community/nixvim.git
synced 2025-12-06 00:51:05 +01:00
plugins/haskell-tools: add hlsPackageFallback option
Signed-off-by: saygo-png <saygo.mail@proton.me>
This commit is contained in:
parent
ee6ccaae42
commit
2d8db68a8f
1 changed files with 11 additions and 1 deletions
|
|
@ -18,6 +18,15 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
||||||
hlsPackage = lib.mkPackageOption pkgs "haskell-language-server" {
|
hlsPackage = lib.mkPackageOption pkgs "haskell-language-server" {
|
||||||
nullable = true;
|
nullable = true;
|
||||||
};
|
};
|
||||||
|
hlsPackageFallback = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = true;
|
||||||
|
description = ''
|
||||||
|
When enabled, hls will be added to the end of the `PATH` _(suffix)_ instead of the beginning _(prefix)_.
|
||||||
|
|
||||||
|
This can be useful if you want local versions of hls (e.g. from a devshell) to override the Nixvim version.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
settingsExample = {
|
settingsExample = {
|
||||||
|
|
@ -43,7 +52,8 @@ lib.nixvim.plugins.mkNeovimPlugin {
|
||||||
|
|
||||||
extraConfig = cfg: {
|
extraConfig = cfg: {
|
||||||
globals.haskell_tools = cfg.settings;
|
globals.haskell_tools = cfg.settings;
|
||||||
extraPackages = [ cfg.hlsPackage ];
|
extraPackages = lib.optionals (!cfg.hlsPackageFallback) [ cfg.hlsPackage ];
|
||||||
|
extraPackagesAfter = lib.optionals cfg.hlsPackageFallback [ cfg.hlsPackage ];
|
||||||
|
|
||||||
plugins.telescope.enabledExtensions = lib.mkIf cfg.enableTelescope [ "ht" ];
|
plugins.telescope.enabledExtensions = lib.mkIf cfg.enableTelescope [ "ht" ];
|
||||||
assertions = lib.nixvim.mkAssertions "plugins.haskell-tools" {
|
assertions = lib.nixvim.mkAssertions "plugins.haskell-tools" {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue