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