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,
lib,
coc-stylelintplus-flake,
tree-sitter-hypr-flake,
...
}: let
fileContents = lib.strings.fileContents;
}:
with lib; let
nvimIde = config.vars.neovimIde;
javaSdk = pkgs.temurin-bin-17;
nvim-treesitter-hypr = tree-sitter-hypr-flake.packages.${pkgs.system}.default;
coc-stylelintplus = coc-stylelintplus-flake.packages.${pkgs.system}.default;
in {
home.packages = with pkgs; [
home.packages = optionalAttrs nvimIde (with pkgs; [
gradle
gradle-completion # FIXME: not working
alejandra
];
]);
# TODO: make a gradle/java module
xdg.dataFile = {
xdg.dataFile = optionalAttrs nvimIde {
".gradle/gradle.properties".text = ''
org.gradle.java.home = ${javaSdk}
'';
};
programs = {
java = {
java = optionalAttrs nvimIde {
enable = true;
package = javaSdk;
};
@ -47,22 +48,24 @@ in {
viAlias = true;
vimAlias = true;
extraPackages = with pkgs; [
extraPackages = with pkgs; ([
bat
gcc
]
++ optionals nvimIde [
nodejs_latest
nodePackages.npm
nodePackages.neovim
gradle
gcc
bat
nil
];
extraPython3Packages = ps: [
]);
extraPython3Packages = ps:
optionals nvimIde [
ps.pylint
];
coc = {
coc = optionalAttrs nvimIde {
enable = true;
settings = {
# General
@ -145,36 +148,9 @@ in {
extraConfig = fileContents ./base.vim;
extraLuaConfig = fileContents ./base.lua;
plugins = with pkgs.vimPlugins; [
# Coc configured
coc-css
coc-eslint
coc-java
coc-sh
coc-stylelintplus
{
plugin = coc-snippets;
type = "viml";
config = fileContents ./plugins/snippets.vim;
}
## Lua
coc-sumneko-lua
neodev-nvim
## Fzf
coc-fzf
plugins = with pkgs.vimPlugins; ([
fzfWrapper
fzf-vim
coc-highlight
coc-json
coc-pyright
coc-vimlsp
coc-yaml
coc-toml
coc-markdownlint
coc-tsserver
fugitive
{
@ -220,6 +196,36 @@ in {
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;
}
## Lua
coc-sumneko-lua
neodev-nvim
## Fzf
coc-fzf
coc-highlight
coc-json
coc-pyright
coc-vimlsp
coc-yaml
coc-toml
coc-markdownlint
coc-tsserver
{
plugin = neo-tree-nvim;
type = "viml";
@ -231,7 +237,7 @@ in {
EOF
'';
}
];
]);
};
};
}

View file

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