diff --git a/home/profiles/nvim/default.nix b/home/profiles/nvim/default.nix index ed1d7014..2db16308 100644 --- a/home/profiles/nvim/default.nix +++ b/home/profiles/nvim/default.nix @@ -629,7 +629,7 @@ in capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) local lspconfig = require('lspconfig') - local servers = { 'clojure_lsp', 'terraform_lsp', 'zls', 'pyright', 'rust_analyzer', 'tsserver', 'sumneko_lua' } + local servers = { 'clojure_lsp', 'terraform_lsp', 'zls', 'pyright', 'rust_analyzer', 'tsserver', 'sumneko_lua', 'fennel-ls' } for _, lsp in ipairs(servers) do lspconfig[lsp].setup { on_attach = function(client, bufnr) @@ -864,6 +864,7 @@ in nodePackages.typescript nodePackages.typescript-language-server sumneko-lua-language-server + fennel-ls ]; plugins = with pkgs.vimPlugins // customPlugins; [ diff --git a/pkgs/default.nix b/pkgs/default.nix index 10259660..fb506e9c 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -4,5 +4,5 @@ { pkgs ? (import ../nixpkgs.nix) { } }: { plymouth-themes = pkgs.callPackage ./plymouth.nix { }; tic-80 = pkgs.callPackage ./tic-80.nix { }; - + fennel-ls = pkgs.callPackage ./fennel-ls.nix { }; } diff --git a/pkgs/fennel-ls.nix b/pkgs/fennel-ls.nix new file mode 100644 index 00000000..3c8ba78f --- /dev/null +++ b/pkgs/fennel-ls.nix @@ -0,0 +1,31 @@ +# Stolen from: https://gist.github.com/jjwatt/c83c02e6903c8ffaf546fe5eb27e7d25?permalink_comment_id=3305141#gistcomment-3305141 +{ pkgs, ... }: +pkgs.stdenv.mkDerivation rec { + name = "fennel-ls"; + src = pkgs.fetchgit { + url = "https://git.sr.ht/~xerool/fennel-ls"; + rev = "70e434839fdf9fad7512118d3f72e38aa8d3ca9f"; + sha256 = "mYOAlSCixlWzykPeLcGyTzWksDAJjblkYwI0k1GuYvE="; + }; + buildInputs = with pkgs; [ + lua + fennel + ]; + + configurePhase = '' + echo [DIRECTORY] $(pwd) + sed -i 's/\.\/fennel/fennel/' Makefile + # cd build/ + # cmake .. + ''; + + buildPhase = '' + make -j4 + ''; + + installPhase = '' + mkdir -p $out/bin + chmod a+x fennel-ls + cp -v fennel-ls $out/bin + ''; +}