Add flake to return home-manager config for neovim
Update lualine config If on nix, auto install all treesitter parsers
This commit is contained in:
parent
921175c7ef
commit
01ea9bc452
278
flake.lock
Normal file
278
flake.lock
Normal file
|
@ -0,0 +1,278 @@
|
|||
{
|
||||
"nodes": {
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1673956053,
|
||||
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": [
|
||||
"neovim-nightly-overlay",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1688466019,
|
||||
"narHash": "sha256-VeM2akYrBYMsb4W/MmBo1zmaMfgbL4cH3Pu8PGyIwJ0=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "8e8d955c22df93dbe24f19ea04f47a74adbdc5ec",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts_2": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1688466019,
|
||||
"narHash": "sha256-VeM2akYrBYMsb4W/MmBo1zmaMfgbL4cH3Pu8PGyIwJ0=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "8e8d955c22df93dbe24f19ea04f47a74adbdc5ec",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "flake-parts",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"flake-parts_3": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": [
|
||||
"neovim-nightly-overlay",
|
||||
"hercules-ci-effects",
|
||||
"hercules-ci-agent",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1688466019,
|
||||
"narHash": "sha256-VeM2akYrBYMsb4W/MmBo1zmaMfgbL4cH3Pu8PGyIwJ0=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "8e8d955c22df93dbe24f19ea04f47a74adbdc5ec",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1685518550,
|
||||
"narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"haskell-flake": {
|
||||
"locked": {
|
||||
"lastModified": 1684780604,
|
||||
"narHash": "sha256-2uMZsewmRn7rRtAnnQNw1lj0uZBMh4m6Cs/7dV5YF08=",
|
||||
"owner": "srid",
|
||||
"repo": "haskell-flake",
|
||||
"rev": "74210fa80a49f1b6f67223debdbf1494596ff9f2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "srid",
|
||||
"ref": "0.3.0",
|
||||
"repo": "haskell-flake",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"hercules-ci-agent": {
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts_3",
|
||||
"haskell-flake": "haskell-flake",
|
||||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1688568579,
|
||||
"narHash": "sha256-ON0M56wtY/TIIGPkXDlJboAmuYwc73Hi8X9iJGtxOhM=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "hercules-ci-agent",
|
||||
"rev": "367dd8cd649b57009a6502e878005a1e54ad78c5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "hercules-ci-agent",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"hercules-ci-effects": {
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts_2",
|
||||
"hercules-ci-agent": "hercules-ci-agent",
|
||||
"nixpkgs": [
|
||||
"neovim-nightly-overlay",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1689397210,
|
||||
"narHash": "sha256-fVxZnqxMbsDkB4GzGAs/B41K0wt/e+B/fLxmTFF/S20=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "hercules-ci-effects",
|
||||
"rev": "0a63bfa3f00a3775ea3a6722b247880f1ffe91ce",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "hercules-ci-effects",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"neovim-flake": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": [
|
||||
"neovim-nightly-overlay",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"dir": "contrib",
|
||||
"lastModified": 1689836628,
|
||||
"narHash": "sha256-CDbbn0N6eiknKa4KrYc6+4LAb4za2IYSw/YGy5BPdcQ=",
|
||||
"owner": "neovim",
|
||||
"repo": "neovim",
|
||||
"rev": "63b3408551561127f7845470eb51404bcd6f547b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"dir": "contrib",
|
||||
"owner": "neovim",
|
||||
"repo": "neovim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"neovim-nightly-overlay": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"flake-parts": "flake-parts",
|
||||
"hercules-ci-effects": "hercules-ci-effects",
|
||||
"neovim-flake": "neovim-flake",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1689897867,
|
||||
"narHash": "sha256-qr3jIEZh6k83i5JBfJ1GuwSTybekrioSnd3iaZACr5g=",
|
||||
"owner": "nix-community",
|
||||
"repo": "neovim-nightly-overlay",
|
||||
"rev": "258dfdf8fec67a1cea88a71d7613584300e062a0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "neovim-nightly-overlay",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1688322751,
|
||||
"narHash": "sha256-eW62dC5f33oKZL7VWlomttbUnOTHrAbte9yNUNW8rbk=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "0fbe93c5a7cac99f90b60bdf5f149383daaa615f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-lib": {
|
||||
"locked": {
|
||||
"dir": "lib",
|
||||
"lastModified": 1688049487,
|
||||
"narHash": "sha256-100g4iaKC9MalDjUW9iN6Jl/OocTDtXdeAj7pEGIRh4=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "4bc72cae107788bf3f24f30db2e2f685c9298dc9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"dir": "lib",
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1690031011,
|
||||
"narHash": "sha256-kzK0P4Smt7CL53YCdZCBbt9uBFFhE0iNvCki20etAf4=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "12303c652b881435065a98729eb7278313041e49",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"neovim-nightly-overlay": "neovim-nightly-overlay",
|
||||
"nixpkgs": "nixpkgs_2"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
63
flake.nix
Normal file
63
flake.nix
Normal file
|
@ -0,0 +1,63 @@
|
|||
{
|
||||
description = "Personal NeoVim configuration";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
neovim-nightly-overlay = {
|
||||
url = "github:nix-community/neovim-nightly-overlay";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = {neovim-nightly-overlay, ...}: let
|
||||
extraPackages = {pkgs, ...}:
|
||||
with pkgs; [
|
||||
# Misc utils
|
||||
curl
|
||||
fzf
|
||||
git
|
||||
gnutar
|
||||
gnumake
|
||||
gnused
|
||||
gcc
|
||||
ripgrep
|
||||
tree-sitter
|
||||
|
||||
# Language servers
|
||||
nil
|
||||
lua-language-server
|
||||
fortls
|
||||
nodePackages.pyright
|
||||
nodePackages.yaml-language-server
|
||||
nodePackages.vim-language-server
|
||||
nodePackages.bash-language-server
|
||||
|
||||
# Null LSP formatters
|
||||
alejandra
|
||||
beautysh
|
||||
black
|
||||
nodePackages.fixjson
|
||||
fprettify
|
||||
isort
|
||||
python3Packages.mdformat
|
||||
shellharden
|
||||
stylua
|
||||
];
|
||||
in {
|
||||
overlay = neovim-nightly-overlay.overlay;
|
||||
homeManagerModules.default = {pkgs, ...}: {
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
package = pkgs.neovim-nightly;
|
||||
defaultEditor = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
vimdiffAlias = true;
|
||||
withNodeJs = true;
|
||||
withRuby = true;
|
||||
withPython3 = true;
|
||||
extraPackages = extraPackages pkgs;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -12,22 +12,22 @@ return {
|
|||
globalstatus = true,
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { { "mode", separator = { left = "" }, right_padding = 2 } },
|
||||
lualine_a = { "mode" },
|
||||
lualine_b = { "filename", { "branch", icon = "" }, "diff" },
|
||||
lualine_c = {
|
||||
{
|
||||
"diagnostics",
|
||||
symbols = {
|
||||
error = " ",
|
||||
warn = " ",
|
||||
info = " ",
|
||||
hint = " ",
|
||||
error = require("ui.lsp_icons").Error,
|
||||
warn = require("ui.lsp_icons").Warn,
|
||||
info = require("ui.lsp_icons").Info,
|
||||
hint = require("ui.lsp_icons").Hint,
|
||||
},
|
||||
},
|
||||
},
|
||||
lualine_x = { "filetype", "fileformat", "encoding" },
|
||||
lualine_y = { "progress" },
|
||||
lualine_z = { "selectioncount", { "location", separator = { right = "" }, left_padding = 2 } },
|
||||
lualine_z = { "selectioncount", "location" },
|
||||
},
|
||||
tabline = {},
|
||||
winbar = {},
|
||||
|
|
|
@ -1,24 +1,4 @@
|
|||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
version = false,
|
||||
build = ":TSUpdate",
|
||||
cmd = {"TSUpdate", "TSInstall"},
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = "nvim-treesitter/nvim-treesitter-refactor",
|
||||
config = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
-- @type table<string, boolean>
|
||||
local added = {}
|
||||
opts.ensure_installed = vim.tbl_filter(function(lang)
|
||||
if added[lang] then return false end
|
||||
added[lang] = true
|
||||
return true
|
||||
end, opts.ensure_installed)
|
||||
end
|
||||
require("nvim-treesitter.configs").setup(opts)
|
||||
end,
|
||||
opts = {
|
||||
auto_install = vim.fn.executable "nix" == 1,
|
||||
local options = {
|
||||
highlight = {
|
||||
enable = true,
|
||||
disable = { "fortran" },
|
||||
|
@ -50,5 +30,31 @@ return {
|
|||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
if vim.fn.executable "nix" == 1 then
|
||||
options.auto_install = true
|
||||
options.ensure_installed = "all"
|
||||
end
|
||||
|
||||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
version = false,
|
||||
build = ":TSUpdate",
|
||||
cmd = { "TSUpdate", "TSInstall" },
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
dependencies = "nvim-treesitter/nvim-treesitter-refactor",
|
||||
config = function(_, opts)
|
||||
if type(opts.ensure_installed) == "table" then
|
||||
-- @type table<string, boolean>
|
||||
local added = {}
|
||||
opts.ensure_installed = vim.tbl_filter(function(lang)
|
||||
if added[lang] then return false end
|
||||
added[lang] = true
|
||||
return true
|
||||
end, opts.ensure_installed)
|
||||
end
|
||||
require("nvim-treesitter.configs").setup(opts)
|
||||
end,
|
||||
opts = options,
|
||||
}
|
||||
|
|
44
neovim.nix
Normal file
44
neovim.nix
Normal file
|
@ -0,0 +1,44 @@
|
|||
{pkgs, ...}: {
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
vimdiffAlias = true;
|
||||
withNodeJs = true;
|
||||
withRuby = true;
|
||||
withPython3 = true;
|
||||
extraPackages = with pkgs; [
|
||||
# Misc utils
|
||||
curl
|
||||
fzf
|
||||
git
|
||||
gnutar
|
||||
gnumake
|
||||
gnused
|
||||
gcc
|
||||
ripgrep
|
||||
tree-sitter
|
||||
|
||||
# Language servers
|
||||
nil
|
||||
lua-language-server
|
||||
fortls
|
||||
nodePackages.pyright
|
||||
nodePackages.yaml-language-server
|
||||
nodePackages.vim-language-server
|
||||
nodePackages.bash-language-server
|
||||
|
||||
# Null LSP formatters
|
||||
alejandra
|
||||
beautysh
|
||||
black
|
||||
nodePackages.fixjson
|
||||
fprettify
|
||||
isort
|
||||
python3Packages.mdformat
|
||||
shellharden
|
||||
stylua
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue