feat(nvim): add option to not install IDE stuff

This commit is contained in:
matt1432 2023-12-08 12:50:38 -05:00
parent a500d682bb
commit b04e6e5ab9
2 changed files with 114 additions and 103 deletions

View file

@ -1,31 +1,32 @@
{ {
config,
pkgs, pkgs,
lib, lib,
coc-stylelintplus-flake, coc-stylelintplus-flake,
tree-sitter-hypr-flake, tree-sitter-hypr-flake,
... ...
}: let }:
fileContents = lib.strings.fileContents; with lib; let
nvimIde = config.vars.neovimIde;
javaSdk = pkgs.temurin-bin-17; javaSdk = pkgs.temurin-bin-17;
nvim-treesitter-hypr = tree-sitter-hypr-flake.packages.${pkgs.system}.default; nvim-treesitter-hypr = tree-sitter-hypr-flake.packages.${pkgs.system}.default;
coc-stylelintplus = coc-stylelintplus-flake.packages.${pkgs.system}.default; coc-stylelintplus = coc-stylelintplus-flake.packages.${pkgs.system}.default;
in { in {
home.packages = with pkgs; [ home.packages = optionalAttrs nvimIde (with pkgs; [
gradle gradle
gradle-completion # FIXME: not working gradle-completion # FIXME: not working
alejandra alejandra
]; ]);
# TODO: make a gradle/java module xdg.dataFile = optionalAttrs nvimIde {
xdg.dataFile = {
".gradle/gradle.properties".text = '' ".gradle/gradle.properties".text = ''
org.gradle.java.home = ${javaSdk} org.gradle.java.home = ${javaSdk}
''; '';
}; };
programs = { programs = {
java = { java = optionalAttrs nvimIde {
enable = true; enable = true;
package = javaSdk; package = javaSdk;
}; };
@ -47,22 +48,24 @@ in {
viAlias = true; viAlias = true;
vimAlias = true; vimAlias = true;
extraPackages = with pkgs; [ extraPackages = with pkgs; ([
nodejs_latest bat
nodePackages.npm gcc
nodePackages.neovim ]
gradle ++ optionals nvimIde [
gcc nodejs_latest
nodePackages.npm
nodePackages.neovim
gradle
nil
]);
bat extraPython3Packages = ps:
optionals nvimIde [
ps.pylint
];
nil coc = optionalAttrs nvimIde {
];
extraPython3Packages = ps: [
ps.pylint
];
coc = {
enable = true; enable = true;
settings = { settings = {
# General # General
@ -145,93 +148,96 @@ in {
extraConfig = fileContents ./base.vim; extraConfig = fileContents ./base.vim;
extraLuaConfig = fileContents ./base.lua; extraLuaConfig = fileContents ./base.lua;
plugins = with pkgs.vimPlugins; [ plugins = with pkgs.vimPlugins; ([
# Coc configured fzfWrapper
coc-css fzf-vim
coc-eslint fugitive
coc-java
coc-sh
coc-stylelintplus
{
plugin = coc-snippets;
type = "viml";
config = fileContents ./plugins/snippets.vim;
}
## Lua {
coc-sumneko-lua plugin = dracula-nvim;
neodev-nvim type = "viml";
config = fileContents ./plugins/dracula.vim;
}
{
plugin = lualine-nvim;
type = "lua";
config = fileContents ./plugins/lualine.lua;
}
{
plugin = todo-comments-nvim;
type = "lua";
config = "require('todo-comments').setup()";
}
{
plugin = gitsigns-nvim;
type = "lua";
config = fileContents ./plugins/gitsigns.lua;
}
{
plugin = nvim-autopairs;
type = "lua";
config = fileContents ./plugins/autopairs.lua;
}
nvim-treesitter-context
nvim-treesitter-textobjects
nvim-treesitter-hypr
{
plugin = nvim-treesitter.withAllGrammars;
type = "viml";
config = fileContents ./plugins/treesitter.vim;
}
{
plugin = indent-blankline-nvim;
type = "lua";
config = fileContents ./plugins/indent.lua;
}
{
plugin = mini-nvim;
type = "lua";
config = fileContents ./plugins/mini.lua;
}
]
++ optionals nvimIde [
# Coc configured
coc-css
coc-eslint
coc-java
coc-sh
coc-stylelintplus
{
plugin = coc-snippets;
type = "viml";
config = fileContents ./plugins/snippets.vim;
}
## Fzf ## Lua
coc-fzf coc-sumneko-lua
fzfWrapper neodev-nvim
fzf-vim
coc-highlight ## Fzf
coc-json coc-fzf
coc-pyright
coc-vimlsp
coc-yaml
coc-toml
coc-markdownlint
coc-tsserver
fugitive
{ coc-highlight
plugin = dracula-nvim; coc-json
type = "viml"; coc-pyright
config = fileContents ./plugins/dracula.vim; coc-vimlsp
} coc-yaml
{ coc-toml
plugin = lualine-nvim; coc-markdownlint
type = "lua"; coc-tsserver
config = fileContents ./plugins/lualine.lua;
}
{
plugin = todo-comments-nvim;
type = "lua";
config = "require('todo-comments').setup()";
}
{
plugin = gitsigns-nvim;
type = "lua";
config = fileContents ./plugins/gitsigns.lua;
}
{
plugin = nvim-autopairs;
type = "lua";
config = fileContents ./plugins/autopairs.lua;
}
nvim-treesitter-context
nvim-treesitter-textobjects
nvim-treesitter-hypr
{
plugin = nvim-treesitter.withAllGrammars;
type = "viml";
config = fileContents ./plugins/treesitter.vim;
}
{
plugin = indent-blankline-nvim;
type = "lua";
config = fileContents ./plugins/indent.lua;
}
{
plugin = mini-nvim;
type = "lua";
config = fileContents ./plugins/mini.lua;
}
{
plugin = neo-tree-nvim;
type = "viml";
config = ''
${fileContents ./plugins/neotree.vim}
lua << EOF {
${fileContents ./plugins/neotree.lua} plugin = neo-tree-nvim;
EOF type = "viml";
''; config = ''
} ${fileContents ./plugins/neotree.vim}
];
lua << EOF
${fileContents ./plugins/neotree.lua}
EOF
'';
}
]);
}; };
}; };
} }

View file

@ -46,5 +46,10 @@
fontSize = mkOption { fontSize = mkOption {
type = types.nullOr types.float; type = types.nullOr types.float;
}; };
neovimIde = mkOption {
type = types.bool;
default = true;
};
}; };
} }