Skip to content

Commit 2d8db68

Browse files
saygo-pngMattSturgeon
authored andcommitted
plugins/haskell-tools: add hlsPackageFallback option
Signed-off-by: saygo-png <[email protected]>
1 parent ee6ccaa commit 2d8db68

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

plugins/by-name/haskell-tools/default.nix

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ lib.nixvim.plugins.mkNeovimPlugin {
1818
hlsPackage = lib.mkPackageOption pkgs "haskell-language-server" {
1919
nullable = true;
2020
};
21+
hlsPackageFallback = lib.mkOption {
22+
type = lib.types.bool;
23+
default = true;
24+
description = ''
25+
When enabled, hls will be added to the end of the `PATH` _(suffix)_ instead of the beginning _(prefix)_.
26+
27+
This can be useful if you want local versions of hls (e.g. from a devshell) to override the Nixvim version.
28+
'';
29+
};
2130
};
2231

2332
settingsExample = {
@@ -43,7 +52,8 @@ lib.nixvim.plugins.mkNeovimPlugin {
4352

4453
extraConfig = cfg: {
4554
globals.haskell_tools = cfg.settings;
46-
extraPackages = [ cfg.hlsPackage ];
55+
extraPackages = lib.optionals (!cfg.hlsPackageFallback) [ cfg.hlsPackage ];
56+
extraPackagesAfter = lib.optionals cfg.hlsPackageFallback [ cfg.hlsPackage ];
4757

4858
plugins.telescope.enabledExtensions = lib.mkIf cfg.enableTelescope [ "ht" ];
4959
assertions = lib.nixvim.mkAssertions "plugins.haskell-tools" {

0 commit comments

Comments
 (0)