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;
|
|
|
|
};
|
2023-02-23 13:34:59 +01:00
|
|
|
|
|
|
|
smartcolumn-nvim = pkgs.vimUtils.buildVimPluginFrom2Nix {
|
|
|
|
pname = "smartcolumn-nvim";
|
|
|
|
version = mkVersionInput inputs.smartcolumn-nvim;
|
|
|
|
src = inputs.smartcolumn-nvim;
|
|
|
|
};
|
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; [
|
2023-02-18 17:14:56 +01:00
|
|
|
black
|
|
|
|
isort
|
2023-02-17 12:38:44 +01:00
|
|
|
nil
|
2023-02-18 17:14:56 +01:00
|
|
|
nixpkgs-fmt
|
|
|
|
rustfmt
|
|
|
|
shfmt
|
2023-02-18 13:35:11 +01:00
|
|
|
stylua
|
2023-02-18 17:14:56 +01:00
|
|
|
sumneko-lua-language-server
|
|
|
|
taplo
|
|
|
|
yamlfmt
|
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
|
2023-02-17 22:16:23 +01:00
|
|
|
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-18 16:25:09 +01:00
|
|
|
formatter-nvim
|
2023-02-19 13:24:22 +01:00
|
|
|
gitsigns-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-16 18:03:55 +01:00
|
|
|
neogit
|
|
|
|
noice-nvim
|
|
|
|
nui-nvim # for noice-nvim
|
2023-02-19 13:24:22 +01:00
|
|
|
nvim-autopairs
|
2023-02-17 12:38:44 +01:00
|
|
|
nvim-cmp
|
2023-02-19 13:24:22 +01:00
|
|
|
nvim-lastplace
|
2023-02-17 12:38:44 +01:00
|
|
|
nvim-lspconfig
|
2023-02-17 22:18:34 +01:00
|
|
|
nvim-surround
|
2023-02-19 13:23:49 +01:00
|
|
|
nvim-tree-lua
|
2023-02-17 22:19:47 +01:00
|
|
|
nvim-treesitter-textsubjects
|
2023-02-16 18:03:55 +01:00
|
|
|
nvim-treesitter.withAllGrammars
|
2023-02-17 22:16:23 +01:00
|
|
|
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
|
2023-02-23 13:34:59 +01:00
|
|
|
smartcolumn-nvim
|
2023-02-23 13:37:59 +01:00
|
|
|
telescope-fzf-native-nvim
|
2023-02-16 18:03:55 +01:00
|
|
|
telescope-nvim
|
2023-02-20 19:07:43 +01:00
|
|
|
vim-lion
|
2023-02-16 18:03:55 +01:00
|
|
|
which-key-nvim
|
|
|
|
];
|
2022-07-15 13:11:54 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|