Proper way to run a language server in a nix-shell with neovim lspconfig

This will look for a binary literally named nix-shell /home/apple/repos/nixos/devshells/rust/shell.nix --run 'rust-analyzer', you have to split cmd (see NeoVim’s documentation):

{ "nix-shell", "/home/apple/repos/nixos/devshells/rust/shell.nix", "--run", "rust-analyzer" }