configuration.nix/nvim/nixvim.nix

109 lines
3.1 KiB
Nix
Raw Normal View History

{
pkgs,
lib,
config,
...
2024-05-04 20:57:33 +02:00
} @ args: let
cfg = config.jhome.nvim;
hmAvailable = args ? hmConfig;
nixosAvailable = args ? nixosConfig;
darwinAvailable = args ? darwinConfig;
canSetAsDefault = hmAvailable || nixosAvailable;
notStandalone = hmAvailable || nixosAvailable || darwinAvailable;
2024-05-04 20:57:33 +02:00
in {
[chore] flake.lock: update 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': 'https://git.lix.systems/api/v1/repos/lix-project/lix/archive/068576042b3b58f8180b24a36c07199a1a3fd380.tar.gz?narHash=sha256-/hsqsiw3p5qMpazedgFFZF2sQghbCJIoef7XCpegTXw%3D' (2024-06-13) → 'https://git.lix.systems/api/v1/repos/lix-project/lix/archive/e44dcd63c4d96807536cdcf2afb688a537cce9be.tar.gz?narHash=sha256-cAkgZoiP2eHB%2BV2cPJMcXACzdaWZIMgI5sg4vpH%2BDYo%3D' (2024-06-20) • Updated input 'lix-module': 'https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/4e25f1ab68f2270f9cff59216056c21073db0164.tar.gz?narHash=sha256-m8XYt8NU2T4gvkien7H7LFGXHhSA5z4tHOeuXQ3DJi4%3D' (2024-06-06) → 'https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/909e593ae9f5fe338ab19b4ed9d52bb0ea09bad8.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)
2024-06-21 06:30:18 +02:00
imports = [./options.nix ./plugins.nix ./mappings.nix ./augroups.nix];
config = lib.mkMerge [
2024-05-04 20:57:33 +02:00
(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
2024-05-17 18:50:01 +02:00
colorschemes.gruvbox = {
enable = true;
settings = {
bold = true;
transparent_mode = true;
terminal_colors = true;
};
2024-04-05 11:38:57 +02:00
};
[chore] flake.lock: update 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': 'https://git.lix.systems/api/v1/repos/lix-project/lix/archive/068576042b3b58f8180b24a36c07199a1a3fd380.tar.gz?narHash=sha256-/hsqsiw3p5qMpazedgFFZF2sQghbCJIoef7XCpegTXw%3D' (2024-06-13) → 'https://git.lix.systems/api/v1/repos/lix-project/lix/archive/e44dcd63c4d96807536cdcf2afb688a537cce9be.tar.gz?narHash=sha256-cAkgZoiP2eHB%2BV2cPJMcXACzdaWZIMgI5sg4vpH%2BDYo%3D' (2024-06-20) • Updated input 'lix-module': 'https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/4e25f1ab68f2270f9cff59216056c21073db0164.tar.gz?narHash=sha256-m8XYt8NU2T4gvkien7H7LFGXHhSA5z4tHOeuXQ3DJi4%3D' (2024-06-06) → 'https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/909e593ae9f5fe338ab19b4ed9d52bb0ea09bad8.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)
2024-06-21 06:30:18 +02:00
clipboard.providers.wl-copy.enable = true;
2024-04-05 11:38:57 +02:00
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
};
2024-05-04 20:57:33 +02:00
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
];
2024-06-01 16:24:05 +02:00
# Formatting & linters
extraPackages = [
pkgs.unstable.silicon
2024-06-01 16:24:05 +02:00
pkgs.unstable.alejandra
pkgs.unstable.luajitPackages.jsregexp
pkgs.unstable.statix
pkgs.unstable.stylua
pkgs.unstable.shfmt
pkgs.unstable.taplo
2024-06-01 16:24:05 +02:00
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
'';
})
];
}