From cccde8b6fd6d206ab48f8c4e5bb24542e666ec9b Mon Sep 17 00:00:00 2001 From: Soliprem Date: Fri, 27 Sep 2024 17:43:45 +0200 Subject: [PATCH 1/4] haskell: default to isMaximal --- configuration.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/configuration.nix b/configuration.nix index 832bf95..aa79a06 100644 --- a/configuration.nix +++ b/configuration.nix @@ -63,6 +63,7 @@ isMaximal: { dart.enable = isMaximal; bash.enable = isMaximal; r.enable = isMaximal; + haskell.enable = isMaximal; tailwind.enable = isMaximal; typst.enable = isMaximal; clang = { From b7f296f17077e3da2ad6df627b8caf5e56bdf7b7 Mon Sep 17 00:00:00 2001 From: Soliprem Date: Fri, 27 Sep 2024 17:44:23 +0200 Subject: [PATCH 2/4] haskell: haskell support --- modules/plugins/languages/haskell.nix | 49 +++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 modules/plugins/languages/haskell.nix diff --git a/modules/plugins/languages/haskell.nix b/modules/plugins/languages/haskell.nix new file mode 100644 index 0000000..b2df406 --- /dev/null +++ b/modules/plugins/languages/haskell.nix @@ -0,0 +1,49 @@ +{ + config, + pkgs, + lib, + ... +}: let + inherit (lib.options) mkEnableOption mkOption; + inherit (lib.modules) mkIf mkMerge; + inherit (lib.types) package; + inherit (lib.nvim.types) mkGrammarOption; + + cfg = config.vim.languages.haskell; +in { + options.vim.languages.haskell = { + enable = mkEnableOption "Haskell support"; + + treesitter = { + enable = mkEnableOption "Haskell treesitter" // {default = config.vim.languages.enableTreesitter;}; + package = mkGrammarOption pkgs "haskell"; + }; + + lsp = { + enable = mkEnableOption "Haskell LSP support (haskell-language-server)" // {default = config.vim.languages.enableLSP;}; + + package = mkOption { + description = "haskell_ls package"; + type = package; + default = pkgs.haskellPackages.haskell-language-server; + }; + }; + }; + config = mkIf cfg.enable (mkMerge [ + (mkIf cfg.treesitter.enable { + vim.treesitter.enable = true; + vim.treesitter.grammars = [cfg.treesitter.package]; + }) + + (mkIf cfg.lsp.enable { + vim.lsp.lspconfig.enable = true; + vim.lsp.lspconfig.sources.haskell-ls = '' + lspconfig.haskell_ls.setup { + capabilities = capabilities, + on_attach=default_on_attach, + cmd = "${cfg.lsp.package}/bin/haskell-language-server-wrapper", + } + ''; + }) + ]); +} From accd26bd837e758fca2fb368a1194752ee798a54 Mon Sep 17 00:00:00 2001 From: Soliprem Date: Sun, 20 Oct 2024 12:48:30 +0200 Subject: [PATCH 3/4] haskell: for some reason now LSP works --- modules/plugins/languages/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/plugins/languages/default.nix b/modules/plugins/languages/default.nix index 54a9e1c..f5b8975 100644 --- a/modules/plugins/languages/default.nix +++ b/modules/plugins/languages/default.nix @@ -9,6 +9,7 @@ in { ./elixir.nix ./go.nix ./kotlin.nix + ./haskell.nix ./html.nix ./java.nix ./lua.nix From 8268f13bdd1fc6b45fd581a3c9102baba3e6a20e Mon Sep 17 00:00:00 2001 From: Soliprem Date: Sun, 20 Oct 2024 12:48:37 +0200 Subject: [PATCH 4/4] haskell: for some reason now LSP works --- modules/plugins/languages/haskell.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/plugins/languages/haskell.nix b/modules/plugins/languages/haskell.nix index b2df406..460e15f 100644 --- a/modules/plugins/languages/haskell.nix +++ b/modules/plugins/languages/haskell.nix @@ -23,9 +23,9 @@ in { enable = mkEnableOption "Haskell LSP support (haskell-language-server)" // {default = config.vim.languages.enableLSP;}; package = mkOption { - description = "haskell_ls package"; + description = "haskell-language-server package"; type = package; - default = pkgs.haskellPackages.haskell-language-server; + default = pkgs.haskell-language-server; }; }; }; @@ -37,11 +37,11 @@ in { (mkIf cfg.lsp.enable { vim.lsp.lspconfig.enable = true; - vim.lsp.lspconfig.sources.haskell-ls = '' - lspconfig.haskell_ls.setup { + vim.lsp.lspconfig.sources.hls = '' + lspconfig.hls.setup { capabilities = capabilities, - on_attach=default_on_attach, - cmd = "${cfg.lsp.package}/bin/haskell-language-server-wrapper", + on_attach = default_on_attach, + cmd = {"${cfg.lsp.package}/bin/haskell-language-server"}, } ''; })