refactor: complete overhaul

Complete overhaul of repo structure based on nvix.

See https://github.com/niksingh710/nvix

Signed-off-by: Lander Van den Bulcke <landervandenbulcke@gmail.com>
This commit is contained in:
Lander Van den Bulcke 2025-10-10 14:02:21 +02:00
parent ff2c59724a
commit 61feed4086
Signed by: lander
GPG key ID: 0142722B4B0C536F
75 changed files with 2916 additions and 2314 deletions

7
plugins/lang/csv.nix Normal file
View file

@ -0,0 +1,7 @@
{
plugins = {
csvview = {
enable = true;
};
};
}

9
plugins/lang/default.nix Normal file
View file

@ -0,0 +1,9 @@
{ lib, ... }:
{
imports =
with builtins;
with lib;
map (fn: ./${fn}) (
filter (fn: (fn != "default.nix" && !hasSuffix ".md" "${fn}")) (attrNames (readDir ./.))
);
}

3
plugins/lang/go.nix Normal file
View file

@ -0,0 +1,3 @@
{
plugins.lsp.servers.gopls.enable = true;
}

7
plugins/lang/haskell.nix Normal file
View file

@ -0,0 +1,7 @@
{
plugins.lsp.servers.hls = {
enable = true;
installGhc = false;
packageFallback = true;
};
}

33
plugins/lang/lua.nix Normal file
View file

@ -0,0 +1,33 @@
{ lib, pkgs, ... }:
{
plugins = {
lsp.servers = {
lua_ls = {
enable = true;
settings.diagnostics = {
disable = [ "miss-name" ];
globals = [
"vim"
"cmp"
"Snacks"
];
};
};
};
conform-nvim = {
enable = true;
settings = {
formatters_by_ft = {
lua = [ "stylua" ];
};
formatters = {
stylua = {
command = "${lib.getExe pkgs.stylua}";
};
};
};
};
};
}

85
plugins/lang/md.nix Normal file
View file

@ -0,0 +1,85 @@
{
config,
lib,
...
}:
let
inherit (config.myvim.mkKey) wKeyObj;
inherit (lib.nixvim) mkRaw;
in
{
plugins = {
img-clip.enable = true;
markdown-preview.enable = true;
render-markdown.enable = true;
mkdnflow = {
enable = true;
toDo.symbols = [
" "
""
"x"
];
mappings = {
MkdnEnter = {
key = "<cr>";
modes = [
"n"
"i"
];
};
MkdnToggleToDo = {
key = "<c-space>";
modes = [
"n"
"i"
];
};
};
};
glow = {
enable = true;
lazyLoad.settings = {
ft = "markdown";
cmd = "Glow";
};
};
conform-nvim.settings = {
formatters_by_ft = {
markdown = {
__unkeyed-1 = "prettierd";
__unkeyed-2 = "prettier";
stop_after_first = true;
};
};
};
};
autoCmd = [
{
desc = "Setup Markdown mappings";
event = "Filetype";
pattern = "markdown";
callback =
# lua
mkRaw ''
function()
-- Set keymap: <leader>p to save and convert to PDF using pandoc
vim.api.nvim_buf_set_keymap(0, 'n', '<leader>pg', '<cmd>Glow<CR>', { desc = "Markdown Glow preview", noremap = true, silent = true })
vim.api.nvim_buf_set_keymap(0, 'n', '<leader>pb', '<cmd>MarkdownPreview<CR>', { desc = "Markdown Browser Preview", noremap = true, silent = true })
vim.api.nvim_buf_set_keymap(0, 'n', '<leader>pp', '<cmd> lua require("md-pdf").convert_md_to_pdf()<CR>', { desc = "Markdown Print pdf", noremap = true, silent = true })
end
'';
}
];
wKeyList = [
(wKeyObj [
"<leader>p"
""
"preview"
])
];
}

26
plugins/lang/nix.nix Normal file
View file

@ -0,0 +1,26 @@
{ lib, pkgs, ... }:
{
plugins = {
lsp.servers = {
nil_ls = {
enable = true;
};
statix = {
enable = true;
};
};
conform-nvim.settings = {
formatters_by_ft = {
nix = [ "nixfmt-rfc-style" ];
};
formatters = {
nixfmt-rfc-style = {
command = "${lib.getExe pkgs.nixfmt-rfc-style}";
};
};
};
};
}

35
plugins/lang/python.nix Normal file
View file

@ -0,0 +1,35 @@
{ lib, pkgs, ... }:
{
plugins = {
lsp.servers = {
pyright = {
enable = true;
settings = {
pyright.diseableOrganizeInputs = true;
python.analysis.ignore = [ "*" ];
};
};
ruff.enable = true;
};
conform-nvim.settings = {
formatters_by_ft = {
python = [
"black"
"isort"
];
};
formatters = {
black = {
command = "${lib.getExe pkgs.black}";
};
isort = {
command = "${lib.getExe pkgs.isort}";
};
};
};
};
}

6
plugins/lang/ruby.nix Normal file
View file

@ -0,0 +1,6 @@
{
plugins.lsp.servers = {
rubocop.enable = true;
ruby_lsp.enable = true;
};
}

33
plugins/lang/shell.nix Normal file
View file

@ -0,0 +1,33 @@
{ lib, pkgs, ... }:
let
formatter = [
"shellcheck"
"shellharden"
"shfmt"
];
in
{
plugins = {
lsp.servers.bashls.enable = true;
conform-nvim.settings = {
formatters_by_ft = {
bash = formatter;
sh = formatter;
zsh = formatter;
};
formatters = {
shellcheck = {
command = lib.getExe pkgs.shellcheck;
};
shellharden = {
command = lib.getExe pkgs.shellharden;
};
shfmt = {
command = lib.getExe pkgs.shfmt;
};
};
};
};
}

18
plugins/lang/tofu.nix Normal file
View file

@ -0,0 +1,18 @@
{ lib, pkgs, ... }:
{
plugins = {
lsp.servers.terraformls = {
enable = true;
settings = {
terraform.path = lib.getExe pkgs.opentofu;
};
};
conform-nvim.settings = {
formatters_by_ft = {
terraform = [ "terraform_fmt" ];
};
};
};
}

51
plugins/lang/webdev.nix Normal file
View file

@ -0,0 +1,51 @@
{ lib, pkgs, ... }:
{
plugins = {
lsp.servers = {
cssls.enable = true;
eslint.enable = true;
html.enable = true;
jsonls.enable = true;
ts_ls.enable = true;
tailwindcss.enable = true;
};
conform-nvim.settings = {
formatters_by_ft = {
css = {
__unkeyed-1 = "prettierd";
__unkeyed-2 = "prettier";
stop_after_first = true;
};
html = {
__unkeyed-1 = "prettierd";
__unkeyed-2 = "prettier";
stop_after_first = true;
};
javascript = {
__unkeyed-1 = "prettierd";
__unkeyed-2 = "prettier";
stop_after_first = true;
};
json = [ "jq" ];
typescript = {
__unkeyed-1 = "prettierd";
__unkeyed-2 = "prettier";
stop_after_first = true;
};
};
formatters = {
jq = {
command = "${lib.getExe pkgs.jq}";
};
prettierd = {
command = "${lib.getExe pkgs.prettierd}";
};
};
};
ts-autotag.enable = true;
ts-comments.enable = true;
};
}

36
plugins/lang/yaml.nix Normal file
View file

@ -0,0 +1,36 @@
{
plugins = {
lsp.servers = {
yamlls = {
enable = true;
settings.yaml = {
schemas = {
kubernetes = "'*.yaml";
"http://json.schemastore.org/github-workflow" = ".github/workflows/*";
"http://json.schemastore.org/github-action" = ".github/action.{yml,yaml}";
"http://json.schemastore.org/ansible-stable-2.9" = "roles/tasks/*.{yml,yaml}";
"http://json.schemastore.org/kustomization" = "kustomization.{yml,yaml}";
"http://json.schemastore.org/ansible-playbook" = "*play*.{yml,yaml}";
"http://json.schemastore.org/chart" = "Chart.{yml,yaml}";
"https://json.schemastore.org/dependabot-v2" = ".github/dependabot.{yml,yaml}";
"https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json" =
"*docker-compose*.{yml,yaml}";
"https://raw.githubusercontent.com/argoproj/argo-workflows/master/api/jsonschema/schema.json" =
"*flow*.{yml,yaml}";
};
};
};
};
conform-nvim.settings = {
formatters_by_ft = {
yaml = {
__unkeyed-1 = "prettierd";
__unkeyed-2 = "prettier";
stop_after_first = true;
};
};
};
};
}