2023-11-22 15:33:16 -05:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: let
|
2023-07-19 21:52:35 -04:00
|
|
|
# installs a vim plugin from git with a given tag / branch
|
2023-11-24 20:59:07 -05:00
|
|
|
plugin = src:
|
2023-11-22 15:33:16 -05:00
|
|
|
pkgs.vimUtils.buildVimPlugin {
|
2023-11-24 20:59:07 -05:00
|
|
|
pname = "${lib.strings.sanitizeDerivationName src.repo}";
|
|
|
|
version = src.rev;
|
|
|
|
inherit src;
|
|
|
|
};
|
|
|
|
|
2023-10-27 01:15:33 -04:00
|
|
|
fileContents = lib.strings.fileContents;
|
|
|
|
in {
|
2023-10-28 18:20:09 -04:00
|
|
|
# TODO: make a gradle module and have java in device-vars.nix
|
2023-10-27 01:15:33 -04:00
|
|
|
xdg.dataFile = {
|
2023-11-22 15:33:16 -05:00
|
|
|
".gradle/gradle.properties".source = pkgs.writeText "gradle.properties" ''
|
|
|
|
org.gradle.java.home = ${pkgs.temurin-bin-17}
|
|
|
|
'';
|
2023-09-19 23:23:19 -04:00
|
|
|
};
|
2023-10-22 15:35:25 -04:00
|
|
|
home.packages = with pkgs; [
|
|
|
|
gradle
|
|
|
|
gradle-completion # FIXME: not working
|
2023-11-22 15:33:16 -05:00
|
|
|
alejandra
|
2023-10-22 15:35:25 -04:00
|
|
|
];
|
|
|
|
|
2023-10-15 15:11:59 -04:00
|
|
|
programs = {
|
|
|
|
java = {
|
2023-09-19 12:54:00 -04:00
|
|
|
enable = true;
|
2023-10-15 15:11:59 -04:00
|
|
|
package = pkgs.temurin-bin-17;
|
|
|
|
};
|
|
|
|
|
|
|
|
neovim = {
|
|
|
|
enable = true;
|
2023-11-19 14:39:10 -05:00
|
|
|
package = pkgs.neovim-nightly;
|
2023-10-26 16:33:40 -04:00
|
|
|
withNodeJs = true;
|
|
|
|
withPython3 = true;
|
|
|
|
withRuby = false;
|
|
|
|
|
2023-10-26 00:35:24 -04:00
|
|
|
defaultEditor = true;
|
2023-10-15 15:11:59 -04:00
|
|
|
viAlias = true;
|
|
|
|
vimAlias = true;
|
|
|
|
|
|
|
|
extraPackages = with pkgs; [
|
|
|
|
nodejs_latest
|
2023-10-26 00:35:24 -04:00
|
|
|
nodePackages.npm
|
|
|
|
nodePackages.neovim
|
2023-10-15 15:11:59 -04:00
|
|
|
gradle
|
2023-11-24 20:59:07 -05:00
|
|
|
gcc
|
2023-10-26 00:35:24 -04:00
|
|
|
|
2023-10-15 15:11:59 -04:00
|
|
|
bat
|
|
|
|
|
|
|
|
nil
|
|
|
|
];
|
2023-11-19 15:09:57 -05:00
|
|
|
extraPython3Packages = ps: [
|
|
|
|
ps.pylint
|
2023-10-26 00:35:24 -04:00
|
|
|
];
|
2023-10-15 15:11:59 -04:00
|
|
|
|
|
|
|
coc = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
2023-10-26 16:33:40 -04:00
|
|
|
# General
|
2023-11-22 16:22:00 -05:00
|
|
|
colors.enable = true;
|
|
|
|
coc.preferences.formatOnType = true;
|
|
|
|
diagnostic.checkCurrentLine = true;
|
|
|
|
inlayHint.enable = false;
|
2023-10-20 21:06:44 -04:00
|
|
|
|
2023-11-22 16:22:00 -05:00
|
|
|
# ESLint
|
|
|
|
eslint = {
|
|
|
|
format.enable = true;
|
|
|
|
autoFixOnSave = true;
|
|
|
|
};
|
2023-10-26 16:33:40 -04:00
|
|
|
|
2023-10-27 01:15:33 -04:00
|
|
|
# Stylelint
|
2023-11-22 16:22:00 -05:00
|
|
|
stylelintplus = {
|
|
|
|
enable = true;
|
|
|
|
cssInJs = true;
|
|
|
|
autoFixOnSave = true;
|
|
|
|
autoFixOnFormat = true;
|
|
|
|
};
|
|
|
|
css.validate = false;
|
|
|
|
less.validate = false;
|
|
|
|
scss.validate = false;
|
|
|
|
wxss.validate = false;
|
2023-10-20 21:06:44 -04:00
|
|
|
|
2023-11-22 16:22:00 -05:00
|
|
|
# Lua
|
|
|
|
Lua = {
|
|
|
|
misc.parameters = [
|
|
|
|
"--metapath"
|
|
|
|
"~/.cache/sumneko_lua/meta"
|
|
|
|
"--logpath"
|
|
|
|
"~/.cache/sumneko_lua/log"
|
|
|
|
];
|
|
|
|
workspace.library = [
|
|
|
|
"$\{3rd\}/luv/library"
|
|
|
|
];
|
|
|
|
};
|
2023-10-15 15:11:59 -04:00
|
|
|
sumneko-lua = {
|
|
|
|
serverDir = "${pkgs.lua-language-server}/share/lua-language-server";
|
|
|
|
enableNvimLuaDev = true;
|
|
|
|
};
|
2023-10-20 21:06:44 -04:00
|
|
|
|
2023-10-15 15:11:59 -04:00
|
|
|
languageserver = {
|
2023-11-22 16:22:00 -05:00
|
|
|
# Nix
|
2023-10-15 15:11:59 -04:00
|
|
|
nix = {
|
|
|
|
command = "nil";
|
2023-11-22 15:33:16 -05:00
|
|
|
filetypes = ["nix"];
|
|
|
|
rootPatterns = ["flake.nix"];
|
|
|
|
settings = {
|
|
|
|
nil = {
|
|
|
|
formatting = {command = ["alejandra"];};
|
|
|
|
};
|
|
|
|
};
|
2023-10-15 15:11:59 -04:00
|
|
|
};
|
2023-09-19 12:54:00 -04:00
|
|
|
};
|
2023-10-26 16:33:40 -04:00
|
|
|
|
2023-11-22 16:22:00 -05:00
|
|
|
# Java
|
|
|
|
java.jdt.ls = {
|
|
|
|
java.home = "${pkgs.temurin-bin-17}";
|
|
|
|
statusIcons = {
|
|
|
|
"busy" = "Busy";
|
|
|
|
"ready" = "OK";
|
|
|
|
"warning" = "Warning";
|
|
|
|
"error" = "Error";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# Bash
|
|
|
|
bashIde.shellcheckPath = "${pkgs.shellcheck}/bin/shellcheck";
|
2023-09-19 12:54:00 -04:00
|
|
|
};
|
|
|
|
};
|
2023-10-03 11:08:56 -04:00
|
|
|
|
2023-10-27 01:15:33 -04:00
|
|
|
extraConfig = fileContents ./base.vim;
|
2023-11-22 15:33:16 -05:00
|
|
|
extraLuaConfig = fileContents ./base.lua;
|
2023-10-15 15:11:59 -04:00
|
|
|
|
2023-11-24 20:59:07 -05:00
|
|
|
plugins = let
|
|
|
|
# custom packages
|
|
|
|
hypr-src = pkgs.fetchFromGitHub {
|
|
|
|
owner = "luckasRanarison";
|
|
|
|
repo = "tree-sitter-hypr";
|
|
|
|
rev = "90b3ddf8a85b5ea3d9dc4920fddb16182a192e14";
|
|
|
|
hash = "sha256-ErFs2eCC0eZEyDldrTUj4JJ0Eu+exDHNQx4g8WXh/UQ=";
|
|
|
|
};
|
|
|
|
|
|
|
|
tree-sitter-hypr = plugin hypr-src;
|
|
|
|
|
2023-11-25 22:11:34 -05:00
|
|
|
hypr-grammar = pkgs.tree-sitter.buildGrammar {
|
|
|
|
language = "hypr";
|
2023-11-24 20:59:07 -05:00
|
|
|
src = hypr-src;
|
2023-11-25 22:11:34 -05:00
|
|
|
version = hypr-src.rev;
|
2023-11-24 20:59:07 -05:00
|
|
|
generate = true;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
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
|
|
|
|
fzfWrapper
|
|
|
|
fzf-vim
|
|
|
|
|
|
|
|
coc-highlight
|
|
|
|
coc-json
|
|
|
|
coc-pyright
|
|
|
|
coc-vimlsp
|
|
|
|
coc-yaml
|
|
|
|
coc-toml
|
|
|
|
coc-markdownlint
|
|
|
|
coc-tsserver
|
|
|
|
fugitive
|
|
|
|
|
|
|
|
{
|
|
|
|
plugin = dracula-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
|
|
|
|
{
|
|
|
|
plugin = tree-sitter-hypr;
|
|
|
|
type = "lua";
|
|
|
|
config = ''
|
|
|
|
vim.treesitter.language.require_language("hypr", "${hypr-grammar}/parser")
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
{
|
|
|
|
plugin = nvim-treesitter.withAllGrammars;
|
|
|
|
type = "viml";
|
|
|
|
config = fileContents ./plugins/treesitter.vim;
|
|
|
|
}
|
|
|
|
{
|
2023-11-25 22:12:47 -05:00
|
|
|
plugin = indent-blankline-nvim;
|
2023-11-24 20:59:07 -05:00
|
|
|
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}
|
|
|
|
EOF
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
];
|
2023-10-15 15:11:59 -04:00
|
|
|
};
|
2023-07-19 21:52:35 -04:00
|
|
|
};
|
|
|
|
}
|