update: neovim lsp
This commit is contained in:
parent
e63917ca85
commit
43e394c86a
14 changed files with 244 additions and 128 deletions
|
|
@ -45,9 +45,6 @@
|
|||
nix-version = "25.05";
|
||||
in
|
||||
{
|
||||
formatter.x86_64-linux =
|
||||
nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style;
|
||||
|
||||
nixosConfigurations = {
|
||||
dn-pre7780 = nixpkgs.lib.nixosSystem {
|
||||
modules = [
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ require("lazy").setup({
|
|||
{ import = "lazyvim.plugins.extras.lang.markdown" },
|
||||
{ import = "lazyvim.plugins.extras.lang.nushell" },
|
||||
{ import = "lazyvim.plugins.extras.lang.omnisharp" },
|
||||
{ import = "lazyvim.plugins.extras.lang.python" },
|
||||
-- { import = "lazyvim.plugins.extras.lang.python" },
|
||||
{ import = "lazyvim.plugins.extras.lang.rust" },
|
||||
{ import = "lazyvim.plugins.extras.lang.tailwind" },
|
||||
{ import = "lazyvim.plugins.extras.lang.toml" },
|
||||
|
|
|
|||
|
|
@ -1,8 +1,37 @@
|
|||
local util = require("lspconfig.util")
|
||||
require("lspconfig").lua_ls.setup({
|
||||
on_init = function(client)
|
||||
local path = client.workspace_folders[1].name
|
||||
if vim.loop.fs_stat(path .. "/.luarc.json") or vim.loop.fs_stat(path .. "/.luarc.jsonc") then
|
||||
return
|
||||
end
|
||||
|
||||
client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua, {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using
|
||||
-- (most likely LuaJIT in the case of Neovim)
|
||||
version = "LuaJIT",
|
||||
},
|
||||
-- Make the server aware of Neovim runtime files
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
library = {
|
||||
vim.env.VIMRUNTIME,
|
||||
-- Depending on the usage, you might want to add additional paths here.
|
||||
"${3rd}/luv/library",
|
||||
-- "${3rd}/busted/library",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
settings = {
|
||||
Lua = {},
|
||||
},
|
||||
})
|
||||
|
||||
return {
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
event = "LazyFile",
|
||||
opts = {
|
||||
servers = {
|
||||
-- biome = {
|
||||
|
|
@ -14,7 +43,35 @@ return {
|
|||
-- or util.find_git_ancestor(fname)
|
||||
-- end,
|
||||
-- },
|
||||
nil_ls = false,
|
||||
nixd = {
|
||||
cmd = { "nixd" },
|
||||
settings = {
|
||||
nixd = {
|
||||
nixpkgs = {
|
||||
expr = "import <nixpkgs> { }",
|
||||
},
|
||||
formatting = {
|
||||
command = { "nixfmt" },
|
||||
},
|
||||
options = {
|
||||
nixos = {
|
||||
expr = '(builtins.getFlake ("git+file://" + toString ./.)).nixosConfigurations.k-on.options',
|
||||
},
|
||||
home_manager = {
|
||||
expr = '(builtins.getFlake ("git+file://" + toString ./.)).homeConfigurations."ruixi@k-on".options',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
nginx_language_server = {
|
||||
cmd = { "nginx-language-server" },
|
||||
filetypes = { "nginx" },
|
||||
rootPatterns = { "nginx.conf", ".git" },
|
||||
},
|
||||
},
|
||||
},
|
||||
setup = {},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
11
home/config/nvim/lua/plugins/markdown-preview.lua
Normal file
11
home/config/nvim/lua/plugins/markdown-preview.lua
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
return {
|
||||
{
|
||||
"iamcco/markdown-preview.nvim",
|
||||
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
|
||||
build = "cd app && yarn install",
|
||||
init = function()
|
||||
vim.g.mkdp_filetypes = { "markdown" }
|
||||
end,
|
||||
ft = { "markdown" },
|
||||
},
|
||||
}
|
||||
5
home/config/nvim/lua/plugins/mason.lua
Normal file
5
home/config/nvim/lua/plugins/mason.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
-- Mason is not usable on NixOS
|
||||
return {
|
||||
{ "williamboman/mason-lspconfig.nvim", enabled = false },
|
||||
{ "williamboman/mason.nvim", enabled = false },
|
||||
}
|
||||
7
home/config/nvim/lua/plugins/suda.lua
Normal file
7
home/config/nvim/lua/plugins/suda.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
{
|
||||
"lambdalisue/vim-suda",
|
||||
cmd = "SudaWrite",
|
||||
keys = { { "<leader>bs", "<cmd>SudaWrite<cr>", desc = "Save Buffer as Root" } },
|
||||
},
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
{ config, pkgs, pkgsUnstable, nix-version, ... }:
|
||||
{ nix-version, ... }:
|
||||
|
||||
{
|
||||
imports = [ ./user ];
|
||||
|
|
|
|||
|
|
@ -1,12 +1,9 @@
|
|||
{ pkgs, ... }:
|
||||
let configDir = ../config;
|
||||
{ ... }:
|
||||
let
|
||||
configDir = ../config;
|
||||
in
|
||||
{
|
||||
home.file = {
|
||||
# ".config/nvim" = {
|
||||
# source = "${configDir}/nvim";
|
||||
# recursive = true;
|
||||
# };
|
||||
".config/wallpapers".source = "${configDir}/wallpapers";
|
||||
".config/kitty".source = "${configDir}/kitty";
|
||||
".config/neofetch".source = "${configDir}/neofetch";
|
||||
|
|
|
|||
|
|
@ -1,10 +1,14 @@
|
|||
let
|
||||
userName = "dachxy";
|
||||
email = "Danny10132024@gmail.com";
|
||||
in {
|
||||
in
|
||||
{
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = userName;
|
||||
userEmail = email;
|
||||
extraConfig = {
|
||||
safe.directory = [ "/etc/nixos" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,33 +1,35 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
let
|
||||
treesitterWithGrammars = (pkgs.vimPlugins.nvim-treesitter.withPlugins (p: [
|
||||
p.bash
|
||||
p.comment
|
||||
p.css
|
||||
p.dockerfile
|
||||
p.fish
|
||||
p.gitattributes
|
||||
p.gitignore
|
||||
p.go
|
||||
p.gomod
|
||||
p.gowork
|
||||
p.hcl
|
||||
p.javascript
|
||||
p.jq
|
||||
p.json5
|
||||
p.json
|
||||
p.lua
|
||||
p.make
|
||||
p.markdown
|
||||
p.nix
|
||||
p.python
|
||||
p.rust
|
||||
p.toml
|
||||
p.typescript
|
||||
p.vue
|
||||
p.yaml
|
||||
]));
|
||||
treesitterWithGrammars = (
|
||||
pkgs.vimPlugins.nvim-treesitter.withPlugins (p: [
|
||||
p.bash
|
||||
p.comment
|
||||
p.css
|
||||
p.dockerfile
|
||||
p.fish
|
||||
p.gitattributes
|
||||
p.gitignore
|
||||
p.go
|
||||
p.gomod
|
||||
p.gowork
|
||||
p.hcl
|
||||
p.javascript
|
||||
p.jq
|
||||
p.json5
|
||||
p.json
|
||||
p.lua
|
||||
p.make
|
||||
p.markdown
|
||||
p.nix
|
||||
p.python
|
||||
p.rust
|
||||
p.toml
|
||||
p.typescript
|
||||
p.vue
|
||||
p.yaml
|
||||
])
|
||||
);
|
||||
|
||||
treesitter-parsers = pkgs.symlinkJoin {
|
||||
name = "treesitter-parsers";
|
||||
|
|
@ -36,13 +38,20 @@ let
|
|||
configDir = ../config;
|
||||
in
|
||||
{
|
||||
# Other Lsp servers are defined in system/module/lsp.nix
|
||||
home.packages = with pkgs; [
|
||||
ripgrep
|
||||
fd
|
||||
lua-language-server
|
||||
black
|
||||
nodejs_22
|
||||
gh
|
||||
vue-language-server
|
||||
dockerfile-language-server-nodejs
|
||||
black
|
||||
prettierd
|
||||
javascript-typescript-langserver
|
||||
marksman
|
||||
tailwindcss-language-server
|
||||
ruff
|
||||
ruff-lsp
|
||||
pyright
|
||||
hadolint
|
||||
];
|
||||
|
||||
programs.neovim = {
|
||||
|
|
@ -51,9 +60,13 @@ in
|
|||
coc.enable = false;
|
||||
withNodeJs = true;
|
||||
|
||||
plugins = [
|
||||
treesitterWithGrammars
|
||||
];
|
||||
plugins =
|
||||
[
|
||||
treesitterWithGrammars
|
||||
]
|
||||
++ (with pkgs.vimPlugins; [
|
||||
markdown-preview-nvim
|
||||
]);
|
||||
extraPackages = [ pkgs.imagemagick ];
|
||||
extraLuaPackages = ps: with ps; [ magick ];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -24,5 +24,6 @@
|
|||
./display-manager.nix
|
||||
./gc.nix
|
||||
./polkit.nix
|
||||
./lsp.nix
|
||||
];
|
||||
}
|
||||
|
|
|
|||
17
system/modules/lsp.nix
Normal file
17
system/modules/lsp.nix
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
ripgrep
|
||||
fd
|
||||
lua-language-server
|
||||
nodejs_22
|
||||
nixfmt-rfc-style
|
||||
markdownlint-cli2
|
||||
shfmt
|
||||
nixd
|
||||
marksman
|
||||
nginx-language-server
|
||||
nodePackages_latest.vscode-json-languageserver
|
||||
];
|
||||
}
|
||||
|
|
@ -1,89 +1,96 @@
|
|||
{ pkgs, inputs, system, ... }:
|
||||
{
|
||||
environment.systemPackages = (with pkgs; [
|
||||
# gtk theme
|
||||
gtk3
|
||||
adwaita-icon-theme
|
||||
pkgs,
|
||||
inputs,
|
||||
system,
|
||||
...
|
||||
}:
|
||||
{
|
||||
environment.systemPackages =
|
||||
(with pkgs; [
|
||||
# gtk theme
|
||||
gtk3
|
||||
adwaita-icon-theme
|
||||
|
||||
# Browser
|
||||
firefox
|
||||
# Browser
|
||||
firefox
|
||||
|
||||
# File Manager
|
||||
nemo
|
||||
# File Manager
|
||||
nemo
|
||||
|
||||
# Utils
|
||||
bat
|
||||
btop
|
||||
eza
|
||||
fzf
|
||||
neofetch
|
||||
ripgrep
|
||||
tree
|
||||
tldr # Alternative for man
|
||||
wget
|
||||
unzip
|
||||
p7zip
|
||||
killall
|
||||
zip
|
||||
glxinfo # OpenGL info
|
||||
pciutils # PCI info
|
||||
xdotool # Keyboard input simulation
|
||||
ffmpeg # Video encoding
|
||||
mpv # Media player
|
||||
brightnessctl
|
||||
# Utils
|
||||
bat
|
||||
btop
|
||||
eza
|
||||
fzf
|
||||
neofetch
|
||||
ripgrep
|
||||
tree
|
||||
tldr # Alternative for man
|
||||
wget
|
||||
unzip
|
||||
p7zip
|
||||
killall
|
||||
zip
|
||||
glxinfo # OpenGL info
|
||||
pciutils # PCI info
|
||||
xdotool # Keyboard input simulation
|
||||
ffmpeg # Video encoding
|
||||
mpv # Media player
|
||||
brightnessctl
|
||||
|
||||
# Dev
|
||||
git
|
||||
gh # Github cli tool
|
||||
gnumake
|
||||
lm_sensors
|
||||
libsForQt5.qt5.qtquickcontrols2
|
||||
libsForQt5.qt5.qtgraphicaleffects
|
||||
libsForQt5.qt5.qtsvg
|
||||
openssl
|
||||
openssl.dev
|
||||
pkg-config # Include Lib
|
||||
nodejs
|
||||
yarn-berry
|
||||
dotnetCorePackages.sdk_8_0_3xx
|
||||
dotnetCorePackages.dotnet_9.sdk
|
||||
dotnetCorePackages.dotnet_9.runtime
|
||||
dotnetCorePackages.dotnet_9.aspnetcore
|
||||
rustup
|
||||
# Dev
|
||||
git
|
||||
gh # Github cli tool
|
||||
gnumake
|
||||
lm_sensors
|
||||
libsForQt5.qt5.qtquickcontrols2
|
||||
libsForQt5.qt5.qtgraphicaleffects
|
||||
libsForQt5.qt5.qtsvg
|
||||
openssl
|
||||
openssl.dev
|
||||
pkg-config # Include Lib
|
||||
nodejs
|
||||
yarn-berry
|
||||
dotnetCorePackages.sdk_8_0_3xx
|
||||
dotnetCorePackages.dotnet_9.sdk
|
||||
dotnetCorePackages.dotnet_9.runtime
|
||||
dotnetCorePackages.dotnet_9.aspnetcore
|
||||
rustup
|
||||
gcc
|
||||
|
||||
# Editor
|
||||
neovim
|
||||
stylua
|
||||
lazygit
|
||||
lua51Packages.lua
|
||||
lua51Packages.luarocks
|
||||
luajitPackages.magick
|
||||
imagemagick
|
||||
# Editor
|
||||
neovim
|
||||
stylua
|
||||
lazygit
|
||||
luajitPackages.lua
|
||||
lua51Packages.lua
|
||||
luajitPackages.luarocks
|
||||
luajitPackages.magick
|
||||
imagemagick
|
||||
|
||||
# Shell
|
||||
fishPlugins.done
|
||||
fishPlugins.fzf-fish
|
||||
fishPlugins.forgit
|
||||
fishPlugins.hydro
|
||||
fishPlugins.grc
|
||||
grc # Colorize
|
||||
zoxide # Dir jumper
|
||||
starship # Shell theme
|
||||
carapace # Autocomplete
|
||||
# Shell
|
||||
fishPlugins.done
|
||||
fishPlugins.fzf-fish
|
||||
fishPlugins.forgit
|
||||
fishPlugins.hydro
|
||||
fishPlugins.grc
|
||||
grc # Colorize
|
||||
zoxide # Dir jumper
|
||||
starship # Shell theme
|
||||
carapace # Autocomplete
|
||||
|
||||
# USB auto mount
|
||||
usbutils
|
||||
udiskie
|
||||
udisks
|
||||
# USB auto mount
|
||||
usbutils
|
||||
udiskie
|
||||
udisks
|
||||
|
||||
# Media
|
||||
vlc
|
||||
# Media
|
||||
vlc
|
||||
|
||||
# Thumbnail
|
||||
ffmpegthumbnailer
|
||||
]) ++ ([
|
||||
inputs.ghostty.packages.${system}.default
|
||||
]);
|
||||
# Thumbnail
|
||||
ffmpegthumbnailer
|
||||
])
|
||||
++ ([
|
||||
inputs.ghostty.packages.${system}.default
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -33,8 +33,8 @@ in
|
|||
set -g status-left "#[fg=#84977f,bg=default,bold] █ session: #S"
|
||||
set -g status-right " #[fg=#828bb8,bg=default,bold]${config.networking.hostName} "
|
||||
|
||||
setw -g window-status-format "#[bg=default] #[fg=#495361,bg=default]#(${getIconScript}/get-icon #I) #W"
|
||||
setw -g window-status-current-format "#[bg=default] #[fg=#7e93a9,bg=default,bold]#(${getIconScript}/get-icon #I) #W"
|
||||
setw -g window-status-format "#[bg=#171616,bg=default] #[fg=#495361,bg=default]#(${getIconScript}/get-icon #I) #W"
|
||||
setw -g window-status-current-format "#[fg=#7e93a9,bg=default] #[fg=#7e93a9,bg=default,bold]#(${getIconScript}/get-icon #I) #W"
|
||||
|
||||
|
||||
set -g default-terminal "xterm-256color"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue