dotfiles/modules/programs/nvim/default.nix

95 lines
2.1 KiB
Nix
Raw Normal View History

2022-07-15 13:11:54 +02:00
{ config
, lib
, pkgs
, ...
}:
with lib;
let
cfg = config.my.programs.nvim;
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
{
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 = lib.concatLines (
builtins.map
builtins.readFile
2023-03-26 18:28:49 +02:00
[ ./options.lua ./keybinds.lua ./init.lua ]
);
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
];
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
friendly-snippets
2023-03-02 09:13:46 +01:00
lsp_lines-nvim
lspkind-nvim
lspsaga-nvim-original
lualine-lsp-progress
luasnip
nui-nvim
2023-03-02 09:13:46 +01:00
nvim-cmp
nvim-lspconfig
nvim-treesitter.withAllGrammars
nvim-ufo
nvim-web-devicons
plenary-nvim
2023-03-02 09:13:46 +01:00
popup-nvim
promise-async
vim-fugitive
2023-03-02 09:13:46 +01:00
vim-lion
] ++ pluginsWithConfig;
2023-03-02 09:13:46 +01:00
};
2022-07-15 13:11:54 +02:00
};
};
}