Closed ElrohirGT closed 3 months ago
My bad! I didn' notice nixpkgs was targeting 23.11 instead of unstable!
Ok so I've deleted the flake.lock and changed the MRE to this:
{
description = "Mermaid LSP flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/unstable";
systems.url = "github:nix-systems/default";
rust-overlay.url = "github:oxalica/rust-overlay";
devenv = {
url = "github:cachix/devenv";
inputs.nixpkgs.follows = "nixpkgs";
};
nixvim = {
# If you are not running an unstable channel of nixpkgs,
# select the corresponding branch of nixvim.
# url = "github:nix-community/nixvim/nixos-23.05";
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
};
};
nixConfig = {
extra-trusted-public-keys = "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=";
extra-substituters = "https://devenv.cachix.org";
};
outputs = {
self,
nixpkgs,
systems,
rust-overlay,
devenv,
nixvim,
...
} @ inputs: let
overlays = [(import rust-overlay)];
forEachSystem = nixpkgs.lib.genAttrs (import systems);
in {
packages = forEachSystem (system: let
pkgs = import nixpkgs {inherit system overlays;};
rustVersion = pkgs.rust-bin.stable.latest.default;
rustPlatform = pkgs.makeRustPlatform {
cargo = rustVersion;
rustc = rustVersion;
};
in {
# For setting up devenv
devenv-up = self.devShells.${system}.default.config.procfileScript;
vim = nixvim.legacyPackages.${system}.makeNixvim {};
nvim = nixvim.legacyPackages.${system}.makeNixvim {
colorschemes.gruvbox.enable = true;
extraConfigLua = ''
# TODO: Add extra config of vim here!
local client = vim.lsp.start_client {
name = "mermaid_lsp",
cmd = {"path to my lsp"}
}
if not client then
vim.notify "Hey! You did an upsie configuring the client for the LSP!"
return
end
vim.api.nvim_create_autocmd("FileType", {
pattern = "markdown",
callback = function()
vim.lsp.buf_attach_client(0, client)
end
})
'';
};
});
devShells = forEachSystem (system: let
pkgs = import nixpkgs {inherit system overlays;};
in {
default = devenv.lib.mkShell {
inherit pkgs inputs;
modules = [
{
packages = with pkgs; [
# Latest stable release
(rust-bin.stable.latest.default)
];
}
];
};
});
};
}
But it still gives the same error!
Turns out I didn't check the correct file before so the MRE failed the same. The fix was to just make nixpkgs follow unstable as my previous comment denied incorrectly. Sorry to bug you all with my skill issue
No worry ! Glad you fixed it :)
none
unstable
none
Description
I'm trying to have a simple neovim config to test an LSP I'm developing, ideally I would like to run:
nix run .#vim
and that should generate a neovim config with my LSP configured to it. But even though I added nixvim to my flake inputs it doesn't build and fails with:Minimal, Reproducible Example (MRE)
Any help would be greatly appreciated!