dotfiles/modules/programs/nvim/default.nix

104 lines
2.3 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.nvim;
mkPlugin = name: {
plugin = pkgs.vimPlugins.${name};
type = "lua";
config = lib.readFile (./plugins + "/${name}.lua");
};
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 = 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
2023-03-13 09:07:50 +01:00
nodePackages.bash-language-server
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
stylua
sumneko-lua-language-server
taplo
yamlfmt
];
plugins = builtins.map mkPlugin [
"catppuccin-nvim"
"comment-nvim"
"copilot-lua"
"dashboard-nvim"
"formatter-nvim"
"gitsigns-nvim"
"lualine-nvim"
"noice-nvim"
"nvim-autopairs"
"nvim-lastplace"
"nvim-surround"
"nvim-tree-lua"
"nvim-treesitter-textsubjects"
"nvim-ts-context-commentstring"
"orgmode"
"smartcolumn-nvim"
"telescope-fzf-native-nvim"
"telescope-nvim"
"telescope-zoxide"
"which-key-nvim"
"todo-comments-nvim"
] ++ (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
impatient-nvim
2023-03-02 09:13:46 +01:00
lsp_lines-nvim
lspkind-nvim
lspsaga-nvim-original
lualine-lsp-progress
luasnip
nui-nvim # for noice-nvim
nvim-cmp
nvim-lspconfig
nvim-treesitter.withAllGrammars
nvim-ufo
2023-03-02 09:13:46 +01:00
nvim-web-devicons # for dashboard-nvim
plenary-nvim # for telescope, neogit
popup-nvim
promise-async
2023-03-02 09:13:46 +01:00
vim-lion
]);
2023-03-02 09:13:46 +01:00
};
2022-07-15 13:11:54 +02:00
};
};
}