Can’t start LSP clients installed with nix #8457
-
SummaryTrying to set up helix with Home Manager and setting LSP clients commands up with isolated binaries (they aren’t available on Reproduction StepsI tried this:
{
pkgs,
lib,
custom-config,
...
}: let
inherit (lib) mkEnableOption mkOption mkIf types;
cfg = custom-config.helix;
in {
options.helix = {
enable = mkEnableOption "Enbales Helix Editor";
};
config = mkIf cfg.enable {
programs.helix = {
inherit (cfg) enable;
settings = {
theme = "catppuccin_latte";
editor = {
line-number = "relative";
lsp.display-messages = true;
};
keys.normal = {
esc = ["collapse_selection" "keep_primary_selection"];
};
};
languages = {
language-server = let
erl = pkgs.beam.interpreters.erlang_25.overrideAttrs (old: {
configureFlags = ["--disable-jit"] ++ old.configureFlags;
});
beam = pkgs.beam.packagesWith erl;
vscode-lsp = pkgs.nodePackages.vscode-langservers-extracted;
in {
elixir-ls.command = "${beam.elixir-ls}/bin/elixir-ls";
nil.command = "${pkgs.nil}/bin/nil";
clojure-lsp.command = "${pkgs.clojure-lsp}/bin/clojure-lsp";
vscode-html-language-server = {
command = "${vscode-lsp}/bin/vscode-html-language-server";
args = ["--stdio"];
};
vscode-css-language-server = {
command = "${vscode-lsp}/bin/vscode-css-language-server";
args = ["--stdio"];
};
vscode-json-language-server = {
command = "${vscode-lsp}/bin/vscode-json-language-server";
args = ["--stdio"];
};
};
};
};
};
}
[language-server]
[language-server.clojure-lsp]
command = "/nix/store/11xlc87rjqncr22hi03vifx86xv8pbi2-clojure-lsp-2023.05.04-19.38.01/bin/clojure-lsp"
[language-server.elixir-ls]
command = "/nix/store/bfcgy3kj2cj0pjm2vij9js3a1n319ayi-elixir-ls-0.14.6/bin/elixir-ls"
[language-server.nil]
command = "/nix/store/gx7dnibh4m07vywi77pbm1r1sv7zys5c-nil-2023-05-09/bin/nil"
[language-server.vscode-css-language-server]
args = ["--stdio"]
command = "/nix/store/aql6hz4y7z7czsmiff5gqfw074jdkc2w-vscode-langservers-extracted-4.7.0/bin/vscode-css-language-server"
[language-server.vscode-html-language-server]
args = ["--stdio"]
command = "/nix/store/aql6hz4y7z7czsmiff5gqfw074jdkc2w-vscode-langservers-extracted-4.7.0/bin/vscode-html-language-server"
[language-server.vscode-json-language-server]
args = ["--stdio"]
command = "/nix/store/aql6hz4y7z7czsmiff5gqfw074jdkc2w-vscode-langservers-extracted-4.7.0/bin/vscode-json-language-server" I expected this to happen (had installed elixir-ls globally on my system): Screen.Recording.2023-10-03.at.10.55.24.movInstead, this happened: Screen.Recording.2023-10-03.at.10.48.45.movHelix logIf I install $ hx --health elixir
Configured language server: elixir-ls
Binary for language server: /etc/profiles/per-user/zoedsoupe/bin/elixir-ls
Configured debug adapter: None
Highlight queries: ✓
Textobject queries: ✓
Indent queries: ✓ Trying to configure with Home Manager and isolate LSP clients binaries I got: $ hx --health elixir
Configured language server: elixir-ls
Binary for language server: 'elixir-ls' not found in $PATH
Configured debug adapter: None
Highlight queries: ✓
Textobject queries: ✓
Indent queries: ✓ PlatformmacOS Terminal EmulatorWarp Helix Versionhelix 23.05 |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
Of course I could install all LSP clients into my $PATH, but is strange that the home-manager documentation looks like this: https://nix-community.github.io/home-manager/options.html#opt-programs.helix.languages |
Beta Was this translation helpful? Give feedback.
-
What's the output of I am also running Nix and managing my config with it (though not home-manager), so I have symlinks for my Actually I would expect an error on startup with that config since that config should apply to master but not the 23.05 release, unless you are overriding the nixpkgs helix with one that builds from master / the flake. |
Beta Was this translation helpful? Give feedback.
-
So, building from the nix-flake provided by the project, absolute paths should work out of the box, which is the desired behaviour. Thank you for the attentcion. I’ll follow the home-manager issue as something in the build there is broken! |
Beta Was this translation helpful? Give feedback.
So, building from the nix-flake provided by the project, absolute paths should work out of the box, which is the desired behaviour. Thank you for the attentcion. I’ll follow the home-manager issue as something in the build there is broken!