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;
|
2023-03-26 18:27:41 +02:00
|
|
|
extraLuaConfig = lib.concatLines (
|
|
|
|
builtins.map
|
|
|
|
builtins.readFile
|
2023-03-26 18:28:49 +02:00
|
|
|
[ ./options.lua ./keybinds.lua ./init.lua ]
|
2023-03-26 18:27:41 +02:00
|
|
|
);
|
2023-03-02 09:13:46 +01:00
|
|
|
extraPackages = with pkgs; [
|
|
|
|
alejandra
|
|
|
|
black
|
2023-04-10 01:05:25 +02:00
|
|
|
deadnix
|
2023-03-02 09:13:46 +01:00
|
|
|
isort
|
2023-03-02 09:14:27 +01:00
|
|
|
jq
|
2023-03-02 09:13:46 +01:00
|
|
|
nil
|
|
|
|
nixpkgs-fmt
|
2023-03-13 09:07:50 +01:00
|
|
|
nodePackages.bash-language-server
|
2023-04-10 01:05:25 +02:00
|
|
|
nodePackages.cspell
|
2023-03-02 09:13:46 +01:00
|
|
|
rustfmt
|
2023-03-13 09:07:50 +01:00
|
|
|
shellcheck
|
2023-03-02 09:13:46 +01:00
|
|
|
shfmt
|
2023-04-10 01:05:25 +02:00
|
|
|
statix
|
2023-03-02 09:13:46 +01:00
|
|
|
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-04-10 21:55:40 +02:00
|
|
|
friendly-snippets
|
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-11 17:26:15 +01:00
|
|
|
vim-fugitive
|
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
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|