fixed zls freezing nvim issue

This commit is contained in:
Nickiel12 2024-10-10 03:04:12 +00:00
parent 1ae80a316d
commit 2b49d644ad
3 changed files with 173 additions and 10 deletions

View file

@ -131,6 +131,22 @@
"url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
} }
}, },
"flake-compat_4": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-parts": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs-lib": [ "nixpkgs-lib": [
@ -224,6 +240,42 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_5": {
"inputs": {
"systems": "systems_8"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_6": {
"inputs": {
"systems": "systems_9"
},
"locked": {
"lastModified": 1705309234,
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"git-hooks": { "git-hooks": {
"inputs": { "inputs": {
"flake-compat": [ "flake-compat": [
@ -276,6 +328,27 @@
"type": "github" "type": "github"
} }
}, },
"gitignore_2": {
"inputs": {
"nixpkgs": [
"zls",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"headscale": { "headscale": {
"inputs": { "inputs": {
"flake-utils": [ "flake-utils": [
@ -729,7 +802,8 @@
"nixpkgs": "nixpkgs_7", "nixpkgs": "nixpkgs_7",
"nixpkgs-stable": "nixpkgs-stable", "nixpkgs-stable": "nixpkgs-stable",
"nixvim": "nixvim", "nixvim": "nixvim",
"utils": "utils" "utils": "utils",
"zls": "zls"
} }
}, },
"rust-analyzer-src": { "rust-analyzer-src": {
@ -891,6 +965,36 @@
"type": "github" "type": "github"
} }
}, },
"systems_8": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_9": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"treefmt-nix": { "treefmt-nix": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -929,6 +1033,52 @@
"repo": "flake-utils", "repo": "flake-utils",
"type": "github" "type": "github"
} }
},
"zig-overlay": {
"inputs": {
"flake-compat": "flake-compat_4",
"flake-utils": "flake-utils_6",
"nixpkgs": [
"zls",
"nixpkgs"
]
},
"locked": {
"lastModified": 1726402199,
"narHash": "sha256-Q1NZ72dNZivH7KFkzW3wN1AHdAier+Xido+7XDzc++I=",
"owner": "mitchellh",
"repo": "zig-overlay",
"rev": "ca646ec2a1eebe15b2b6bd33811de6f12aa576c4",
"type": "github"
},
"original": {
"owner": "mitchellh",
"repo": "zig-overlay",
"type": "github"
}
},
"zls": {
"inputs": {
"flake-utils": "flake-utils_5",
"gitignore": "gitignore_2",
"nixpkgs": [
"nixpkgs"
],
"zig-overlay": "zig-overlay"
},
"locked": {
"lastModified": 1728483147,
"narHash": "sha256-WWLzEZm9E6aBxoJqahYw4wCwUYV1+ndwGz1gwv87Wzc=",
"owner": "zigtools",
"repo": "zls",
"rev": "6ae67e89267440380f63544312b9113c0a895882",
"type": "github"
},
"original": {
"owner": "zigtools",
"repo": "zls",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View file

@ -4,6 +4,10 @@
inputs = { inputs = {
utils.url = "github:numtide/flake-utils"; utils.url = "github:numtide/flake-utils";
nixvim.url = "github:nix-community/nixvim"; nixvim.url = "github:nix-community/nixvim";
zls = {
url = "github:zigtools/zls";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs = { nixpkgs = {
url = "github:nixos/nixpkgs/nixos-unstable"; url = "github:nixos/nixpkgs/nixos-unstable";
# url = "github:NixOS/nixpkgs/b477b25191fc94ce764428520b83b6b64366e3c8"; # url = "github:NixOS/nixpkgs/b477b25191fc94ce764428520b83b6b64366e3c8";
@ -51,6 +55,7 @@
kmonad, kmonad,
atuin, atuin,
nixos-wsl, nixos-wsl,
zls,
... ...
} @ inputs: } @ inputs:
let let
@ -84,7 +89,7 @@
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
extraSpecialArgs = { extraSpecialArgs = {
inherit user ewwtilities atuin pkgs-stable; inherit user ewwtilities atuin pkgs-stable zls;
}; };
users.${user} = { users.${user} = {
imports = [ imports = [
@ -127,7 +132,7 @@
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
extraSpecialArgs = { extraSpecialArgs = {
inherit user ewwtilities atuin pkgs-stable; inherit user ewwtilities atuin pkgs-stable zls;
}; };
users.${user} = { users.${user} = {
imports = [ imports = [
@ -160,7 +165,7 @@
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
extraSpecialArgs = { extraSpecialArgs = {
inherit user ewwtilities atuin pkgs-stable; inherit user ewwtilities atuin pkgs-stable zls;
}; };
users.${user} = { users.${user} = {
imports = [ imports = [
@ -192,7 +197,7 @@
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
extraSpecialArgs = { extraSpecialArgs = {
inherit user ewwtilities atuin pkgs-stable; inherit user ewwtilities atuin pkgs-stable zls;
}; };
users.${user} = { users.${user} = {
imports = [ imports = [

View file

@ -1,4 +1,4 @@
{ pkgs, lib, ... }: { pkgs, lib, zls, ... }:
let let
in in
{ {
@ -163,16 +163,24 @@ in
plugins = { plugins = {
web-devicons.enable = true; # text icons web-devicons.enable = true; # text icons
typescript-tools.enable = true; typescript-tools.enable = true;
zig.enable = true; zig = {
enable = true;
settings = {
fmt_autosave = 0;
};
};
lsp = { lsp = {
enable = true; enable = true;
servers = { servers = {
zls.enable = true; zls = {
gleam = {
enable = true; enable = true;
autostart = true; package = zls.packages.${pkgs.system}.zls;
}; };
# gleam = {
# enable = true;
# autostart = true;
# };
gopls = { gopls = {
enable = true; enable = true;
}; };