diff --git a/dev_shells.nix b/dev_shells.nix --- a/dev_shells.nix +++ b/dev_shells.nix @@ -5,7 +5,6 @@ pkgs, lib, stdenv, darwin, - lexical, livebook, }: { livebook = pkgs.mkShell { @@ -21,16 +20,14 @@ mkShell { packages = [ erlang rebar3 - erlang-ls ]; }; - elixir = with beam.packages.erlang_27; + elixir = with beam.packages.erlang; mkShell { packages = [ elixir - lexical ]; }; diff --git a/flake.lock b/flake.lock --- a/flake.lock +++ b/flake.lock @@ -21,6 +21,31 @@ "repo": "agnoster", "type": "github" } }, + "beam-flakes": { + "inputs": { + "flake-parts": [ + "expert", + "flake-parts" + ], + "nixpkgs": [ + "expert", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1771594669, + "narHash": "sha256-bjqfo3IobpY0se/LOL6U7J0AodvMTZjZad1x3XLc7HY=", + "owner": "elixir-tools", + "repo": "nix-beam-flakes", + "rev": "da950d6652b5b4bc43ee7c440a39097b4d96e448", + "type": "github" + }, + "original": { + "owner": "elixir-tools", + "repo": "nix-beam-flakes", + "type": "github" + } + }, "darwin": { "inputs": { "nixpkgs": [ @@ -57,6 +82,28 @@ "repo": "nixpkgs", "type": "github" } }, + "expert": { + "inputs": { + "beam-flakes": "beam-flakes", + "flake-parts": "flake-parts", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1772206698, + "narHash": "sha256-wyEBuDbmkifIphiSddyZu/IAVrud1Iu1AyNXVkCTWB0=", + "owner": "elixir-lang", + "repo": "expert", + "rev": "44a43e2d146ddb1a5cd9cce35b5cd7cd8947a94f", + "type": "github" + }, + "original": { + "owner": "elixir-lang", + "repo": "expert", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" @@ -80,11 +127,11 @@ "inputs": { "nixpkgs-lib": "nixpkgs-lib_2" }, "locked": { - "lastModified": 1719994518, - "narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=", + "lastModified": 1769996383, + "narHash": "sha256-AnYjnFWgS49RlqX7LrC4uA+sCCDBj0Ry/WOJ5XWAsa0=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7", + "rev": "57928607ea566b5db3ad13af0e57e921e6b12381", "type": "github" }, "original": { @@ -110,7 +157,7 @@ } }, "flake-utils_2": { "inputs": { - "systems": "systems_2" + "systems": "systems" }, "locked": { "lastModified": 1731533236, @@ -161,26 +208,6 @@ "repo": "home-manager", "type": "github" } }, - "lexical": { - "inputs": { - "flake-parts": "flake-parts_2", - "nixpkgs": "nixpkgs", - "systems": "systems" - }, - "locked": { - "lastModified": 1739906465, - "narHash": "sha256-p8XSJBX1igwC+ssEJGD8wb/ZYaEgLGozlY8N6spo3cA=", - "owner": "lexical-lsp", - "repo": "lexical", - "rev": "477e8b418b27960710109d0014167bb371b0cade", - "type": "github" - }, - "original": { - "owner": "lexical-lsp", - "repo": "lexical", - "type": "github" - } - }, "lix": { "flake": false, "locked": { @@ -220,16 +247,18 @@ } }, "nixpkgs": { "locked": { - "lastModified": 1719931832, - "narHash": "sha256-0LD+KePCKKEb4CcPsTBOwf019wDtZJanjoKm1S8q3Do=", + "lastModified": 1771147098, + "narHash": "sha256-jpfPdBjKO232s5NueoNEvvVzpndiUzPLNYcH4/Ov0gY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0aeab749216e4c073cece5d34bc01b79e717c3e0", + "rev": "e3cb16bccd9facebae3ba29c6a76a4cc1b73462a", "type": "github" }, "original": { - "id": "nixpkgs", - "type": "indirect" + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" } }, "nixpkgs-lib": { @@ -249,29 +278,16 @@ } }, "nixpkgs-lib_2": { "locked": { - "lastModified": 1719876945, - "narHash": "sha256-Fm2rDDs86sHy0/1jxTOKB1118Q0O3Uc7EC0iXvXKpbI=", - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/5daf0514482af3f97abaefc78a6606365c9108e2.tar.gz" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1771147098, - "narHash": "sha256-jpfPdBjKO232s5NueoNEvvVzpndiUzPLNYcH4/Ov0gY=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "e3cb16bccd9facebae3ba29c6a76a4cc1b73462a", + "lastModified": 1769909678, + "narHash": "sha256-cBEymOf4/o3FD5AZnzC3J9hLbiZ+QDT/KDuyHXVJOpM=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "72716169fe93074c333e8d0173151350670b824c", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", + "owner": "nix-community", + "repo": "nixpkgs.lib", "type": "github" } }, @@ -280,30 +296,15 @@ "inputs": { "agnoster": "agnoster", "darwin": "darwin", "darwin-stable": "darwin-stable", - "flake-parts": "flake-parts", + "expert": "expert", + "flake-parts": "flake-parts_2", "home-manager": "home-manager", - "lexical": "lexical", "lix": "lix", "lix-module": "lix-module", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs" } }, "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_2": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", diff --git a/flake.nix b/flake.nix --- a/flake.nix +++ b/flake.nix @@ -34,8 +34,9 @@ # url = "github:nvim-neorg/nixpkgs-neorg-overlay"; # inputs.nixpkgs.follows = "nixpkgs"; # }; - lexical = { - url = "github:lexical-lsp/lexical"; + expert = { + url = "github:elixir-lang/expert"; + inputs.nixpkgs.follows = "nixpkgs"; }; # nixvim = { diff --git a/modules/fish.nix b/modules/fish.nix --- a/modules/fish.nix +++ b/modules/fish.nix @@ -23,6 +23,7 @@ home.sessionVariables = { PAGER = "${pkgs.less}/bin/less"; MANPAGER = "nvim +Man!"; + MANWIDTH = 80; LESS = "-SRFXi"; ERL_FLAGS = "-kernel shell_history enabled"; }; diff --git a/modules/nvim.nix b/modules/nvim.nix --- a/modules/nvim.nix +++ b/modules/nvim.nix @@ -10,16 +10,14 @@ # Add Fennel to Lua path and require basic implementation # # runtimepath editing is not yet perfect, but works good enough so far customRC = let - lexical = pkgs.lexical.override { - beamPackages = pkgs.beam27Packages; - }; + expert = inputs.expert.packages.${pkgs.stdenv.hostPlatform.system}.expert; in '' set runtimepath+=${./nvim}/after set runtimepath^=${./nvim} lua << EOF vim.g.lsp_paths = { ['rust_analyzer'] = "${pkgs.rust-analyzer}/bin/rust-analyzer", - ['lexical'] = "${lexical}/bin/lexical", + ['expert'] = "${expert}/bin/expert", ['elp'] = "${pkgs.erlang-language-platform}/bin/elp", ['typos_lsp'] = "${pkgs.typos-lsp}/bin/typos-lsp" } diff --git a/modules/nvim/fnl/langclient.fnl b/modules/nvim/fnl/langclient.fnl --- a/modules/nvim/fnl/langclient.fnl +++ b/modules/nvim/fnl/langclient.fnl @@ -3,7 +3,7 @@ (use nvim {: fun : cmd : opt : map :buf-map bmap}) (use picker) (import-macros logger :nvim.logger) -(import-macros {: augroup} :nvim) +(import-macros {: augroup : defcommand} :nvim) (let [lsp vim.lsp border :rounded] @@ -40,10 +40,10 @@ :filetypes [ "rust" ] :cmd [vim.g.lsp_paths.rust_analyzer] :settings {:rust-analyzer {:files {:excludeDirs [".direnv"]}}}}) -(setup :lexical { +(setup :expert { :root_markers [ "mix.exs" ".git" ".jj" ] :filetypes [ "elixir" "eelixir" "heex" ] - :cmd [vim.g.lsp_paths.lexical]}) + :cmd [vim.g.lsp_paths.expert "--stdio"]}) (setup :elp { :root_markers [ "rebar.config" ] @@ -67,3 +67,7 @@ ; :filetypes [ "toml" ] ; :cmd [vim.g.lsm_paths.taplo :lsp :stdio]}) ; (augroup lsp-direnv (on User :DirenvLoaded (cmd.LspStart))) + +(defcommand LspRestart {:nargs 1} + (vim.lsp.enable (tostring args) false) + (vim.lsp.enable (tostring args) true)) diff --git a/templates/elixir/flake.nix b/templates/elixir/flake.nix --- a/templates/elixir/flake.nix +++ b/templates/elixir/flake.nix @@ -34,10 +34,6 @@ ... }: { devenv.shells.default = { language.elixir.enable = true; - - packages = [ - pkgs.lexical - ]; }; }; };