Compare commits

...

21 Commits

Author SHA1 Message Date
8245a48cc7
add nixfmt to runtime pkgs 2025-01-10 18:03:29 +01:00
3d82bad6ee
pkgs: add nixfmt-rfc-style 2025-01-08 18:32:17 +01:00
6e26ec33fa
gitignore: update 2024-12-03 23:15:07 +01:00
b9c3cd2e1a
gitignore: update 2024-12-03 23:14:02 +01:00
a09a34997c
lsp: add typist_lsp 2024-12-03 22:33:03 +01:00
127047caeb
lsp: add yaml-lsp-server 2024-12-03 22:24:57 +01:00
60acbede4d
switch nixpkgs to 24.11 2024-12-03 22:09:52 +01:00
9f36693f90
lua -> vim.loop.cwd() -> vim.fn.getcwd() 2024-09-25 16:42:15 +02:00
8fdf9bd08c
flake: update 2024-09-25 16:39:17 +02:00
e3c064d3a9
flake: update 2024-06-19 10:12:55 +02:00
8754d5b79d
flake: update 2024-05-31 11:44:03 +02:00
ba6b926cc4
flake: update 2024-04-12 17:28:34 +02:00
201161972e
packages: re-enable nixd 2024-04-12 17:26:46 +02:00
2b10f5cb32
nvim-lsp: remove implicit pkgs definition 2024-03-16 22:09:08 +01:00
c055bd2a2f
flake: add bundled package, remove nixd over unresolved CVE 2024-03-16 19:06:45 +01:00
f042e08ecd
Revert "flake: add arm64-linux target"
This reverts commit 13bed01615.
2024-03-16 17:12:06 +01:00
13bed01615
flake: add arm64-linux target 2024-03-16 15:32:53 +01:00
3f9559992a
lua: format 2024-03-16 15:22:08 +01:00
9332c56c01
nvim-lsp: remove nativeBuildInputs 2024-03-16 15:09:45 +01:00
a9bc0c8a7a
flake: update 2024-03-16 14:20:14 +01:00
5bba266c6e
flake: add symlink for needed packages in overlay 2024-03-16 14:13:23 +01:00
5 changed files with 54 additions and 37 deletions

3
.gitignore vendored
View File

@ -1 +1,4 @@
result
.ccls-cache/
hello.c
compile_commands.json

15
flake.lock generated
View File

@ -2,17 +2,18 @@
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1698266953,
"narHash": "sha256-jf72t7pC8+8h8fUslUYbWTX5rKsRwOzRMX8jJsGqDXA=",
"owner": "NixOS",
"lastModified": 1733120037,
"narHash": "sha256-En+gSoVJ3iQKPDU1FHrR6zIxSLXKjzKY+pnh9tt+Yts=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "75a52265bda7fd25e06e3a67dee3f0354e73243c",
"rev": "f9f0d5c5380be0a599b1fb54641fa99af8281539",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixpkgs-unstable",
"type": "indirect"
"owner": "nixos",
"ref": "nixos-24.11",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {

View File

@ -2,7 +2,7 @@
description = "A very basic flake";
inputs = {
nixpkgs.url = "nixpkgs/nixpkgs-unstable";
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
};
outputs = {
@ -12,12 +12,34 @@
supportedSystems = ["x86_64-linux" "aarch64-linux"];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system: import nixpkgs {inherit system;});
pkgs = nixpkgs.legacyPackages.x86_64-linux.pkgs;
in {
packages = forAllSystems (system: let
pkgs = nixpkgsFor.${system};
neovim = import ./nvim-lsp.nix {inherit pkgs;};
in {
nvim = import ./nvim-lsp.nix {inherit pkgs;};
nvim = pkgs.symlinkJoin {
name = "nvim";
paths = with pkgs;
[
alejandra
ccls
gopls
luaformatter
nixd
nixfmt-rfc-style
pyright
rust-analyzer
sumneko-lua-language-server
svls
texlab
tree-sitter
typst-lsp
verible
yaml-language-server
zls
]
++ [neovim];
};
});
devShells = forAllSystems (system: let
@ -30,6 +52,7 @@
pkgs.gopls
pkgs.luaformatter
pkgs.nixd
pkgs.nixfmt-rfc-style
pkgs.pyright
pkgs.rust-analyzer
pkgs.sumneko-lua-language-server
@ -43,6 +66,13 @@
};
});
overlays = forAllSystems (system: let
pkgs = nixpkgsFor.${system};
in {
overlay = final: prev: {
nvim = self.packages.${system}.nvim;
};
});
defaultPackage = forAllSystems (system: self.packages.${system}.nvim);
};
}

View File

@ -1,4 +1,4 @@
{pkgs ? import <nixpkgs> {}}: let
{pkgs}: let
neovim = pkgs.neovim.override {
configure = {
customRC = ''
@ -45,21 +45,6 @@
vim-snippets
zig-vim
];
nativeBuildInputs = [
pkgs.alejandra
pkgs.ccls
pkgs.gopls
pkgs.luaformatter
pkgs.nixd
pkgs.pyright
pkgs.rust-analyzer
pkgs.sumneko-lua-language-server
pkgs.svls
pkgs.texlab
pkgs.tree-sitter
pkgs.verible
pkgs.zls
];
};
};

View File

@ -32,11 +32,9 @@ require 'nvim-treesitter.configs'.setup {
indent = { enable = false, disable = {} },
rainbow = {
enable = true,
extended_mode = true, -- Highlight also non-parentheses delimiters, boolean or table: lang -> boolean
max_file_lines = 1000, -- Do not enable for files with more than 1000 lines, int
colors = {
'#ff0000', '#ffa500', '#ffff00', '#008000', '#0051a0', '#8003f2'
} -- table of hex strings
extended_mode = true,
max_file_lines = 1000,
colors = { '#ff0000', '#0051a0' ,'#ffa500', '#ffff00', '#008000', '#8003f2' }
}
}
@ -107,18 +105,18 @@ vim.api.nvim_create_autocmd('LspAttach', {
end
})
vim.diagnostic.config({ virtual_text = false}) -- Turn off inline diagnostics
vim.diagnostic.config({ virtual_text = false }) -- Turn off inline diagnostics
-- Show all diagnostics on current line in floating window
vim.api.nvim_set_keymap( 'n', '<Leader>d', ':lua vim.diagnostic.open_float()<CR>', opts)
vim.api.nvim_set_keymap('n', '<Leader>d', ':lua vim.diagnostic.open_float()<CR>', opts)
-- Go to next diagnostic (if there are multiple on the same line, only shows
-- one at a time in the floating window)
vim.api.nvim_set_keymap( 'n', '<Leader>n', ':lua vim.diagnostic.goto_next()<CR>', opts)
vim.api.nvim_set_keymap('n', '<Leader>n', ':lua vim.diagnostic.goto_next()<CR>', opts)
-- Go to prev diagnostic (if there are multiple on the same line, only shows
-- one at a time in the floating window)
vim.api.nvim_set_keymap( 'n', '<Leader>p', ':lua vim.diagnostic.goto_prev()<CR>', opts)
vim.api.nvim_set_keymap('n', '<Leader>p', ':lua vim.diagnostic.goto_prev()<CR>', opts)
-- Use a loop to conveniently call 'setup' on multiple servers and
-- map buffer local keybindings when the language server attaches
@ -184,7 +182,7 @@ cmp.setup({
}
})
local servers = { 'pyright', 'rust_analyzer', 'ccls', 'nixd', 'texlab', 'zls', 'gopls' }
local servers = { 'pyright', 'rust_analyzer', 'ccls', 'nixd', 'texlab', 'zls', 'gopls', 'yamlls', 'typst_lsp' }
local capabilities = require('cmp_nvim_lsp').default_capabilities()
for _, lsp in pairs(servers) do
require('lspconfig')[lsp].setup {
@ -219,7 +217,7 @@ require('lspconfig').lua_ls.setup({
require('lspconfig').verible.setup({
capabilities = capabilities,
root_dir = function() return vim.loop.cwd() end
root_dir = function() return vim.fn.getcwd() end
})
if vim.fn.exists('+undofile') ~= 0 then