09e9158b85
Also fix neovim errors Flake lock file updates: • Updated input 'home-manager': 'github:nix-community/home-manager/845a5c4c073f74105022533907703441e0464bc3?narHash=sha256-vWSkg6AMok1UUQiSYVdGMOXKD2cDFnajITiSi0Zjd1A%3D' (2024-06-04) → 'github:nix-community/home-manager/a1fddf0967c33754271761d91a3d921772b30d0e?narHash=sha256-BmO8d0r%2BBVlwWtMLQEYnwmngqdXIuyFzMwvmTcLMee8%3D' (2024-06-16) • Updated input 'lix': '068576042b
.tar.gz?narHash=sha256-/hsqsiw3p5qMpazedgFFZF2sQghbCJIoef7XCpegTXw%3D' (2024-06-13) → 'e44dcd63c4
.tar.gz?narHash=sha256-cAkgZoiP2eHB%2BV2cPJMcXACzdaWZIMgI5sg4vpH%2BDYo%3D' (2024-06-20) • Updated input 'lix-module': '4e25f1ab68
.tar.gz?narHash=sha256-m8XYt8NU2T4gvkien7H7LFGXHhSA5z4tHOeuXQ3DJi4%3D' (2024-06-06) → '909e593ae9
.tar.gz?narHash=sha256-DdcMvX9r29uHMlz7P1Shgs5xZw9WkZ4ObMGYzwROAiw%3D' (2024-06-19) • Updated input 'nixos-hardware': 'github:NixOS/nixos-hardware/ae5c8dcc4d0182d07d75df2dc97112de822cb9d6?narHash=sha256-SuPne4BMqh9/IkKIAG47Cu5qfmntAaqlHdX1yuFoDO0%3D' (2024-06-14) → 'github:NixOS/nixos-hardware/083823b7904e43a4fc1c7229781417e875359a42?narHash=sha256-hxQBUtDbFOCCW1CsFZTS9Q5Ov1ZKdJgbBZHSez1M6iA%3D' (2024-06-20) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/cc54fb41d13736e92229c21627ea4f22199fee6b?narHash=sha256-US1tAChvPxT52RV8GksWZS415tTS7PV42KTc2PNDBmc%3D' (2024-06-12) → 'github:NixOS/nixpkgs/dd457de7e08c6d06789b1f5b88fc9327f4d96309?narHash=sha256-wM9v2yIxClRYsGHut5vHICZTK7xdrUGfrLkXvSuv6s4%3D' (2024-06-19) • Updated input 'nixvim': 'github:nix-community/nixvim/7a2a25af02be25987aa43cd681312f4b5ba12317?narHash=sha256-NIJZxmY2CWsqJK/9BQCRSHfcCY9K6thjq/1XtJobxmU%3D' (2024-06-14) → 'github:nix-community/nixvim/744dfea48bdd331e66b9e874822559fa6fae98af?narHash=sha256-artyEBzWUsNXtYj7jBr816wRJj2Y3DYDHw6ECrQotX0%3D' (2024-06-20) • Updated input 'nixvim/treefmt-nix': 'github:numtide/treefmt-nix/1cb529bffa880746a1d0ec4e0f5076876af931f1?narHash=sha256-1TZQcdETNdJMcfwwoshVeCjwWfrPtkSQ8y8wFX3it7k%3D' (2024-06-11) → 'github:numtide/treefmt-nix/68eb1dc333ce82d0ab0c0357363ea17c31ea1f81?narHash=sha256-ULzoKzEaBOiLRtjeY3YoGFJMwWSKRYOic6VNw2UyTls%3D' (2024-06-16) • Updated input 'unstable': 'github:NixOS/nixpkgs/e9ee548d90ff586a6471b4ae80ae9cfcbceb3420?narHash=sha256-4Zu0RYRcAY/VWuu6awwq4opuiD//ahpc2aFHg2CWqFY%3D' (2024-06-13) → 'github:NixOS/nixpkgs/c00d587b1a1afbf200b1d8f0b0e4ba9deb1c7f0e?narHash=sha256-FUZpz9rg3gL8NVPKbqU8ei1VkPLsTIfAJ2fdAf5qjak%3D' (2024-06-18)
108 lines
3.1 KiB
Nix
108 lines
3.1 KiB
Nix
{
|
|
pkgs,
|
|
lib,
|
|
config,
|
|
...
|
|
} @ args: let
|
|
cfg = config.jhome.nvim;
|
|
hmAvailable = args ? hmConfig;
|
|
nixosAvailable = args ? nixosConfig;
|
|
darwinAvailable = args ? darwinConfig;
|
|
canSetAsDefault = hmAvailable || nixosAvailable;
|
|
notStandalone = hmAvailable || nixosAvailable || darwinAvailable;
|
|
in {
|
|
imports = [./options.nix ./plugins.nix ./mappings.nix ./augroups.nix];
|
|
|
|
config = lib.mkMerge [
|
|
(lib.optionalAttrs canSetAsDefault {defaultEditor = lib.mkDefault true;})
|
|
(lib.optionalAttrs notStandalone {enable = lib.mkDefault true;})
|
|
(lib.mkIf cfg.enable {
|
|
package = pkgs.unstable.neovim-unwrapped;
|
|
globals.mapleader = " ";
|
|
# Appearance
|
|
colorschemes.gruvbox = {
|
|
enable = true;
|
|
settings = {
|
|
bold = true;
|
|
transparent_mode = true;
|
|
terminal_colors = true;
|
|
};
|
|
};
|
|
clipboard.providers.wl-copy.enable = true;
|
|
opts = {
|
|
number = true;
|
|
relativenumber = true;
|
|
colorcolumn = "+1";
|
|
cursorline = true;
|
|
wrap = false;
|
|
splitright = true;
|
|
# Tabs & indentation
|
|
smarttab = true;
|
|
autoindent = true;
|
|
smartindent = true;
|
|
# Search path
|
|
path = ".,/usr/include,**";
|
|
wildmenu = true;
|
|
hlsearch = true;
|
|
incsearch = true;
|
|
ignorecase = true; # Search ignores cases
|
|
smartcase = true; # Unless it has a capital letter
|
|
# Enable local configuration :h 'exrc'
|
|
exrc = true; # safe since nvim 0.9
|
|
};
|
|
extraPlugins = let
|
|
plugins = pkgs.unstable.vimPlugins;
|
|
extraPlugins = import ./extraPlugins {pkgs = pkgs.unstable;};
|
|
in [
|
|
plugins.nui-nvim
|
|
plugins.nvim-web-devicons
|
|
extraPlugins.vim-jjdescription
|
|
extraPlugins.nvim-silicon
|
|
];
|
|
# Formatting & linters
|
|
extraPackages = [
|
|
pkgs.unstable.silicon
|
|
pkgs.unstable.alejandra
|
|
pkgs.unstable.luajitPackages.jsregexp
|
|
pkgs.unstable.statix
|
|
pkgs.unstable.stylua
|
|
pkgs.unstable.shfmt
|
|
pkgs.unstable.taplo
|
|
pkgs.unstable.typos
|
|
pkgs.unstable.yamlfmt
|
|
];
|
|
extraConfigLuaPre = ''
|
|
-- Lua Pre Config
|
|
if vim.fn.has 'termguicolors' then
|
|
-- Enable RGB colors
|
|
vim.g.termguicolors = true
|
|
end
|
|
|
|
-- Useful function
|
|
local has_words_before = function()
|
|
-- unpack = unpack or table.unpack
|
|
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
|
return col ~= 0
|
|
and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match '%s' == nil
|
|
end
|
|
-- END: Lua Pre Config
|
|
'';
|
|
extraConfigLua = ''
|
|
-- Lua Config
|
|
require("nvim-silicon").setup {
|
|
theme = "gruvbox-dark",
|
|
pad_horiz = 16,
|
|
pad_vert = 16,
|
|
-- Current buffer name
|
|
window_title = function()
|
|
return vim.fn.fnamemodify(
|
|
vim.api.nvim_buf_get_name(vim.api.nvim_get_current_buf()),
|
|
":t"
|
|
)
|
|
end,
|
|
}
|
|
-- END: Lua Config
|
|
'';
|
|
})
|
|
];
|
|
}
|