mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-09 23:22:57 +00:00
set checks on individual languages
This commit is contained in:
parent
6c2fc0289b
commit
f85a008741
@ -1,10 +1,11 @@
|
||||
{ pkgs, lib, config, dsl, ... }: {
|
||||
|
||||
# Terraform optional because non-free
|
||||
options.terraform = lib.mkEnableOption "Whether to enable Terraform LSP";
|
||||
options.github = lib.mkEnableOption "Whether to enable GitHub features";
|
||||
options.kubernetes =
|
||||
lib.mkEnableOption "Whether to enable Kubernetes features";
|
||||
options.python = lib.mkEnableOption "Whether to enable Python LSP";
|
||||
options.terraform = lib.mkEnableOption "Whether to enable Terraform LSP";
|
||||
|
||||
config =
|
||||
|
||||
@ -18,6 +19,12 @@
|
||||
'' else
|
||||
"";
|
||||
|
||||
pythonFormat = if config.python then ''
|
||||
require("null-ls").builtins.formatting.black.with({ command = "${pkgs.black}/bin/black" }),
|
||||
require("null-ls").builtins.diagnostics.ruff.with({ command = "${pkgs.ruff}/bin/ruff" }),
|
||||
'' else
|
||||
"";
|
||||
|
||||
in {
|
||||
plugins = [
|
||||
pkgs.vimPlugins.nvim-lspconfig
|
||||
@ -41,7 +48,11 @@
|
||||
};
|
||||
|
||||
use.lspconfig.pyright.setup = dsl.callWith {
|
||||
cmd = [ "${pkgs.pyright}/bin/pyright-langserver" "--stdio" ];
|
||||
cmd = if config.python then [
|
||||
"${pkgs.pyright}/bin/pyright-langserver"
|
||||
"--stdio"
|
||||
] else
|
||||
[ "echo" ];
|
||||
};
|
||||
|
||||
use.lspconfig.terraformls.setup = dsl.callWith {
|
||||
@ -70,8 +81,6 @@
|
||||
require("null-ls").setup({
|
||||
sources = {
|
||||
require("null-ls").builtins.formatting.stylua.with({ command = "${pkgs.stylua}/bin/stylua" }),
|
||||
require("null-ls").builtins.formatting.black.with({ command = "${pkgs.black}/bin/black" }),
|
||||
require("null-ls").builtins.diagnostics.ruff.with({ command = "${pkgs.ruff}/bin/ruff" }),
|
||||
require("null-ls").builtins.formatting.fish_indent.with({ command = "${pkgs.fish}/bin/fish_indent" }),
|
||||
require("null-ls").builtins.formatting.nixfmt.with({ command = "${pkgs.nixfmt}/bin/nixfmt" }),
|
||||
require("null-ls").builtins.formatting.rustfmt.with({ command = "${pkgs.rustfmt}/bin/rustfmt" }),
|
||||
@ -80,6 +89,7 @@
|
||||
command = "${pkgs.shfmt}/bin/shfmt",
|
||||
extra_args = { "-i", "4", "-ci" },
|
||||
}),
|
||||
${pythonFormat}
|
||||
${terraformFormat}
|
||||
},
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
{ pkgs, lib, ... }: {
|
||||
{ pkgs, lib, config, ... }: {
|
||||
|
||||
plugins = [
|
||||
(pkgs.vimPlugins.nvim-treesitter.withPlugins (_plugins:
|
||||
with pkgs.tree-sitter-grammars; [
|
||||
with pkgs.tree-sitter-grammars;
|
||||
[
|
||||
tree-sitter-bash
|
||||
tree-sitter-c
|
||||
tree-sitter-fish
|
||||
tree-sitter-hcl
|
||||
tree-sitter-ini
|
||||
tree-sitter-json
|
||||
tree-sitter-lua
|
||||
@ -14,16 +14,15 @@
|
||||
tree-sitter-markdown-inline
|
||||
tree-sitter-nix
|
||||
tree-sitter-puppet
|
||||
tree-sitter-python
|
||||
tree-sitter-rasi
|
||||
tree-sitter-toml
|
||||
tree-sitter-vimdoc
|
||||
tree-sitter-yaml
|
||||
]))
|
||||
] ++ (if config.python.enable then [ tree-sitter-python ] else [ ])
|
||||
++ (if config.terraform.enable then [ tree-sitter-hcl ] else [ ])))
|
||||
pkgs.vimPlugins.vim-matchup # Better % jumping in languages
|
||||
pkgs.vimPlugins.playground # Tree-sitter experimenting
|
||||
pkgs.vimPlugins.nginx-vim
|
||||
pkgs.vimPlugins.vim-helm
|
||||
pkgs.baleia-nvim # Clean ANSI from kitty scrollback
|
||||
# pkgs.hmts-nvim # Tree-sitter injections for home-manager
|
||||
(pkgs.vimUtils.buildVimPlugin {
|
||||
@ -31,7 +30,7 @@
|
||||
version = "0.1";
|
||||
src = ../plugin;
|
||||
})
|
||||
];
|
||||
] ++ (if config.kubernetes.enable then [ pkgs.vimPlugins.vim-helm ] else [ ]);
|
||||
|
||||
setup."nvim-treesitter.configs" = {
|
||||
highlight = { enable = true; };
|
||||
|
@ -5,9 +5,11 @@ let
|
||||
neovim = import ./package {
|
||||
inherit pkgs;
|
||||
colors = config.theme.colors;
|
||||
terraform = config.terraform.enable;
|
||||
c = config.c.enable;
|
||||
github = true;
|
||||
kubernetes = config.kubernetes.enable;
|
||||
python = config.python.enable;
|
||||
terraform = config.terraform.enable;
|
||||
};
|
||||
|
||||
in {
|
||||
|
1
modules/common/programming/c.nix
Normal file
1
modules/common/programming/c.nix
Normal file
@ -0,0 +1 @@
|
||||
{ lib, ... }: { options.c.enable = lib.mkEnableOption "C language tools."; }
|
Loading…
Reference in New Issue
Block a user