2022-07-15 13:11:54 +02:00
|
|
|
{ config
|
|
|
|
, lib
|
|
|
|
, pkgs
|
|
|
|
, ...
|
|
|
|
}:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
let
|
2023-03-04 13:22:48 +01:00
|
|
|
cfg = config.my.programs.nvim;
|
|
|
|
|
2023-03-11 17:00:32 +01:00
|
|
|
mkPlugin = fileName:
|
|
|
|
let
|
|
|
|
path = ./plugins + "/${fileName}";
|
|
|
|
pluginName = lib.removeSuffix ".lua" fileName;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
plugin = pkgs.vimPlugins.${pluginName};
|
|
|
|
type = "lua";
|
|
|
|
config = lib.readFile path;
|
|
|
|
};
|
|
|
|
pluginFileNames = builtins.attrNames (builtins.readDir ./plugins);
|
|
|
|
pluginsWithConfig = builtins.map mkPlugin pluginFileNames;
|
2022-07-15 13:11:54 +02:00
|
|
|
in
|
|
|
|
{
|
2023-03-04 13:22:48 +01:00
|
|
|
options.my.programs.nvim.enable = mkEnableOption "nvim";
|
2022-07-15 13:11:54 +02:00
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2023-03-02 09:13:46 +01:00
|
|
|
home-manager.users.moritz = {
|
|
|
|
home.packages = with pkgs; [
|
|
|
|
(
|
|
|
|
if config.my.programs.hyprland.enable
|
|
|
|
then neovide-hyprland
|
|
|
|
else neovide
|
|
|
|
)
|
2023-02-16 18:03:55 +01:00
|
|
|
];
|
2023-03-02 09:13:46 +01:00
|
|
|
|
|
|
|
programs.neovim = {
|
|
|
|
enable = true;
|
|
|
|
package = pkgs.neovim-nightly;
|
|
|
|
vimAlias = true;
|
|
|
|
vimdiffAlias = true;
|
|
|
|
withNodeJs = true;
|
|
|
|
withPython3 = true;
|
|
|
|
extraLuaConfig = builtins.readFile ./init.lua;
|
|
|
|
extraPackages = with pkgs; [
|
|
|
|
alejandra
|
|
|
|
black
|
|
|
|
isort
|
2023-03-02 09:14:27 +01:00
|
|
|
jq
|
2023-03-02 09:13:46 +01:00
|
|
|
nil
|
|
|
|
nixpkgs-fmt
|
|
|
|
rustfmt
|
|
|
|
shfmt
|
|
|
|
stylua
|
|
|
|
sumneko-lua-language-server
|
|
|
|
taplo
|
|
|
|
yamlfmt
|
|
|
|
];
|
2023-03-11 17:00:32 +01:00
|
|
|
plugins = with pkgs.vimPlugins; [
|
2023-03-02 09:13:46 +01:00
|
|
|
cmp-nvim-lsp
|
|
|
|
cmp_luasnip
|
|
|
|
copilot-cmp
|
2023-03-02 09:46:55 +01:00
|
|
|
direnv-vim
|
2023-03-09 16:17:27 +01:00
|
|
|
impatient-nvim
|
2023-03-02 09:13:46 +01:00
|
|
|
lsp_lines-nvim
|
|
|
|
lspkind-nvim
|
|
|
|
lspsaga-nvim-original
|
|
|
|
lualine-lsp-progress
|
|
|
|
luasnip
|
2023-03-11 17:00:32 +01:00
|
|
|
nui-nvim
|
2023-03-02 09:13:46 +01:00
|
|
|
nvim-cmp
|
|
|
|
nvim-lspconfig
|
|
|
|
nvim-treesitter.withAllGrammars
|
2023-03-04 13:22:48 +01:00
|
|
|
nvim-ufo
|
2023-03-11 17:00:32 +01:00
|
|
|
nvim-web-devicons
|
|
|
|
plenary-nvim
|
2023-03-02 09:13:46 +01:00
|
|
|
popup-nvim
|
2023-03-04 13:22:48 +01:00
|
|
|
promise-async
|
2023-03-02 09:13:46 +01:00
|
|
|
vim-lion
|
2023-03-11 17:00:32 +01:00
|
|
|
] ++ pluginsWithConfig;
|
2023-03-02 09:13:46 +01:00
|
|
|
};
|
2022-07-15 13:11:54 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|