dotfiles/modules/programs/nvim/default.nix

81 lines
1.8 KiB
Nix
Raw Normal View History

2022-07-15 13:11:54 +02:00
{ config
, lib
, pkgs
2023-02-17 22:19:47 +01:00
, inputs
2022-07-15 13:11:54 +02:00
, ...
}:
with lib;
let
cfg = config.my.programs.vim;
2023-02-17 22:19:47 +01:00
mkDate = longDate: (lib.concatStringsSep "-" [
(builtins.substring 0 4 longDate)
(builtins.substring 4 2 longDate)
(builtins.substring 6 2 longDate)
]);
mkVersionInput = input: mkDate (input.lastModifiedDate or "19700101") + "_" + (input.shortRev or "dirty");
nvim-treesitter-textsubjects = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "nvim-treesitter-textsubjects";
version = mkVersionInput inputs.nvim-treesitter-textsubjects;
src = inputs.nvim-treesitter-textsubjects;
};
2022-07-15 13:11:54 +02:00
in
{
options.my.programs.vim = {
enable = mkOption {
default = true;
type = types.bool;
example = false;
};
};
config = mkIf cfg.enable {
home-manager.users.moritz.programs.neovim = {
enable = true;
2023-02-17 12:31:31 +01:00
package = pkgs.neovim-nightly;
2022-07-15 13:11:54 +02:00
vimAlias = true;
vimdiffAlias = true;
withNodeJs = true;
withPython3 = true;
2023-02-16 18:03:55 +01:00
extraLuaConfig = builtins.readFile ./init.lua;
2023-02-17 12:38:44 +01:00
extraPackages = with pkgs; [
sumneko-lua-language-server
nil
2023-02-18 13:35:11 +01:00
stylua
2023-02-17 12:38:44 +01:00
];
2023-02-16 18:03:55 +01:00
plugins = with pkgs.vimPlugins; [
catppuccin-nvim
2023-02-17 12:38:44 +01:00
cmp-nvim-lsp
2023-02-17 22:09:13 +01:00
cmp_luasnip
comment-nvim
2023-02-18 16:23:58 +01:00
copilot-cmp
copilot-lua
2023-02-16 18:03:55 +01:00
dashboard-nvim
2023-02-17 22:09:13 +01:00
lsp_lines-nvim
2023-02-18 16:22:21 +01:00
lspkind-nvim
2023-02-17 22:11:37 +01:00
lualine-lsp-progress
lualine-nvim
2023-02-17 22:09:13 +01:00
luasnip
2023-02-18 13:35:11 +01:00
formatter-nvim
2023-02-16 18:03:55 +01:00
neogit
noice-nvim
nui-nvim # for noice-nvim
2023-02-17 12:38:44 +01:00
nvim-cmp
nvim-lspconfig
2023-02-17 22:18:34 +01:00
nvim-surround
2023-02-17 22:19:47 +01:00
nvim-treesitter-textsubjects
2023-02-16 18:03:55 +01:00
nvim-treesitter.withAllGrammars
nvim-ts-context-commentstring
2023-02-16 18:03:55 +01:00
nvim-web-devicons # for dashboard-nvim
2023-02-18 16:24:38 +01:00
orgmode
2023-02-16 18:03:55 +01:00
plenary-nvim # for telescope, neogit
telescope-nvim
which-key-nvim
];
2022-07-15 13:11:54 +02:00
};
};
}