2024-04-14 05:40:02 -07:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
options.neovim = {
|
|
|
|
|
enable = lib.mkEnableOption "Enables neovim";
|
2024-04-16 04:36:26 -07:00
|
|
|
languages = {
|
2024-04-17 20:59:21 -07:00
|
|
|
c.enable = lib.mkEnableOption "Enables c support";
|
2025-01-09 09:35:51 -08:00
|
|
|
go.enable = lib.mkEnableOption "Enables go support";
|
2024-04-23 23:17:10 -07:00
|
|
|
nix.enable = lib.mkEnableOption "Enables nix support";
|
|
|
|
|
rust.enable = lib.mkEnableOption "Enables rust support";
|
2025-07-01 10:44:39 -07:00
|
|
|
typescript.enable = lib.mkEnableOption "Enables typescript support";
|
2024-04-16 04:36:26 -07:00
|
|
|
};
|
2025-01-09 10:04:32 -08:00
|
|
|
themes = {
|
|
|
|
|
catppuccin.enable = lib.mkEnableOption "Enables catppuccin theme";
|
|
|
|
|
};
|
2024-04-16 04:36:26 -07:00
|
|
|
plugins = {
|
|
|
|
|
comments.enable = lib.mkEnableOption "Enables nvim-comment";
|
|
|
|
|
fugitive.enable = lib.mkEnableOption "Enables git-fugitive";
|
|
|
|
|
lualine.enable = lib.mkEnableOption "Enables lualine";
|
|
|
|
|
luasnip.enable = lib.mkEnableOption "Enables luasnip snippets";
|
|
|
|
|
nvimcmp.enable = lib.mkEnableOption "Enables nvim completion";
|
|
|
|
|
telescope = {
|
|
|
|
|
enable = lib.mkEnableOption "Enables telescope";
|
|
|
|
|
fzf.enable = lib.mkEnableOption "Enables telescope-fzf";
|
|
|
|
|
};
|
|
|
|
|
treesitter.enable = lib.mkEnableOption "Enables treesitter";
|
2024-04-18 00:57:36 -07:00
|
|
|
wiki.enable = lib.mkEnableOption "Enables a wiki";
|
2024-04-16 04:36:26 -07:00
|
|
|
};
|
2024-04-14 05:40:02 -07:00
|
|
|
};
|
|
|
|
|
|
2026-02-18 11:48:11 -08:00
|
|
|
# imports = [
|
|
|
|
|
# ./plugin/lsp.nix
|
|
|
|
|
# ./plugin/nvimcmp.nix
|
|
|
|
|
# ./plugin/telescope.nix
|
|
|
|
|
# ./plugin/treesitter.nix
|
|
|
|
|
# ];
|
2024-04-16 04:36:26 -07:00
|
|
|
|
2024-04-14 05:40:02 -07:00
|
|
|
config = lib.mkIf config.neovim.enable {
|
|
|
|
|
home.sessionVariables = {
|
|
|
|
|
EDITOR = "nvim";
|
|
|
|
|
VISUAL = "nvim";
|
|
|
|
|
};
|
2024-04-16 04:36:26 -07:00
|
|
|
|
2026-02-18 11:48:11 -08:00
|
|
|
programs.nixvim = {
|
2024-04-14 05:40:02 -07:00
|
|
|
enable = true;
|
2024-04-16 04:36:26 -07:00
|
|
|
viAlias = true;
|
|
|
|
|
vimAlias = true;
|
|
|
|
|
vimdiffAlias = true;
|
2026-02-18 11:48:11 -08:00
|
|
|
};
|
|
|
|
|
# extraLuaConfig = ''
|
|
|
|
|
# ${builtins.readFile ./options.lua}
|
|
|
|
|
# '';
|
|
|
|
|
|
|
|
|
|
programs.nixvim.colorschemes = with config.neovim.themes; {
|
|
|
|
|
catppuccin = lib.mkIf catppuccin.enable {
|
|
|
|
|
enable = true;
|
|
|
|
|
flavour = "mocha";
|
|
|
|
|
integrations.vimwiki = lib.mkIf wiki.enable true;
|
|
|
|
|
}
|
|
|
|
|
};
|
2024-04-14 05:40:02 -07:00
|
|
|
|
2026-02-18 11:48:11 -08:00
|
|
|
programs.nixvim.plugins = with config.neovim.plugins; {
|
|
|
|
|
comment.enable = comments.enable;
|
|
|
|
|
|
|
|
|
|
fugitive.enable = fugitive.enable;
|
|
|
|
|
|
|
|
|
|
lualine = lib.mkIf lualine.enable {
|
|
|
|
|
enable = true;
|
|
|
|
|
icons_enabled = true;
|
|
|
|
|
};
|
|
|
|
|
web-devicons.enable = lualine.enable;
|
2025-07-01 10:44:39 -07:00
|
|
|
|
2026-02-18 11:48:11 -08:00
|
|
|
luasnip.enable = luasnip.enable;
|
|
|
|
|
friendly-snippets.enable = luasnip.enable;
|
2025-01-09 10:04:32 -08:00
|
|
|
|
2026-02-18 11:48:11 -08:00
|
|
|
cmp = {
|
|
|
|
|
enable = nvimcmp.enable;
|
|
|
|
|
autoEnableSources = true;
|
|
|
|
|
settings.sources = lib.options luasnip.enable { name = "cmp-luasnip" };
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# telescope = {
|
|
|
|
|
# enable = lib.mkEnableOption "Enables telescope";
|
|
|
|
|
# fzf.enable = lib.mkEnableOption "Enables telescope-fzf";
|
|
|
|
|
# };
|
|
|
|
|
# treesitter.enable = lib.mkEnableOption "Enables treesitter";
|
|
|
|
|
# wiki.enable = lib.mkEnableOption "Enables a wiki";
|
|
|
|
|
#
|
|
|
|
|
#
|
|
|
|
|
# wiki = lopts cfgp.wiki.enable (with pkgs.vimPlugins; [
|
|
|
|
|
# {
|
|
|
|
|
# plugin = vimwiki;
|
|
|
|
|
# type = "lua";
|
|
|
|
|
# config = ''
|
|
|
|
|
# vim.g.vimwiki_list = {
|
|
|
|
|
# {
|
|
|
|
|
# path = '${config.xdg.userDirs.documents}/wiki',
|
|
|
|
|
# links_space_char = '_',
|
|
|
|
|
# ext = '.md',
|
|
|
|
|
# syntax = 'markdown',
|
|
|
|
|
# }
|
|
|
|
|
# }
|
|
|
|
|
# '';
|
|
|
|
|
# }
|
|
|
|
|
# ]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
# extraPackages = with pkgs; [
|
|
|
|
|
# (lib.mkIf config.neovim.languages.c.enable libclang)
|
|
|
|
|
# (lib.mkIf config.neovim.languages.go.enable gopls)
|
|
|
|
|
# (lib.mkIf config.neovim.languages.nix.enable nil)
|
|
|
|
|
# (lib.mkIf config.neovim.languages.rust.enable rust-analyzer)
|
|
|
|
|
# ];
|
|
|
|
|
#
|
|
|
|
|
# # Additional packages are added through imports
|
|
|
|
|
# plugins = let
|
|
|
|
|
# lopts = lib.lists.optionals;
|
|
|
|
|
# cfgp = config.neovim.plugins;
|
|
|
|
|
# cfgl = config.neovim.languages;
|
|
|
|
|
# cfgt = config.neovim.themes;
|
|
|
|
|
#
|
|
|
|
|
# nix-pkg = lopts cfgl.nix.enable (with pkgs.vimPlugins; [
|
|
|
|
|
# vim-nix
|
|
|
|
|
# ]);
|
|
|
|
|
#
|
|
|
|
|
# rust-pkg = lopts cfgl.rust.enable (with pkgs.vimPlugins; [
|
|
|
|
|
# {
|
|
|
|
|
# plugin = rustaceanvim;
|
|
|
|
|
# type = "lua";
|
|
|
|
|
# config = ''
|
|
|
|
|
# vim.g.rust_recommended_style = 0
|
|
|
|
|
# '';
|
|
|
|
|
# }
|
|
|
|
|
# ]);
|
|
|
|
|
#
|
|
|
|
|
# go-pkg = lopts cfgl.go.enable (with pkgs.vimPlugins; [
|
|
|
|
|
# go-nvim
|
|
|
|
|
# ]);
|
|
|
|
|
#
|
|
|
|
|
# typescript-pkg = lopts cfgl.typescript.enable (with pkgs.vimPlugins; [
|
|
|
|
|
# {
|
|
|
|
|
# plugin = typescript-tools-nvim;
|
|
|
|
|
# type = "lua";
|
|
|
|
|
# config = ''
|
|
|
|
|
# require("typescript-tools").setup {}
|
|
|
|
|
# '';
|
|
|
|
|
# }
|
|
|
|
|
# ]);
|
|
|
|
|
# };
|
2024-04-14 05:40:02 -07:00
|
|
|
};
|
|
|
|
|
}
|