development settings, and renaming neovim to nixvim

This commit is contained in:
cnst
2024-08-21 21:21:40 +02:00
parent dd8959e1b4
commit f06c33e482
37 changed files with 349 additions and 267 deletions

View File

@@ -1,38 +0,0 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.conform-nvim;
in
{
options = {
modules.devtools.neovim.plugins.conform-nvim.enable = mkEnableOption "Enables Conform plugin for Neovim";
};
config = mkIf cfg.enable {
programs.nixvim.plugins.conform-nvim = {
enable = true;
formatOnSave = {
lspFallback = true;
timeoutMs = 500;
};
notifyOnError = true;
formattersByFt = {
liquidsoap = [ "liquidsoap-prettier" ];
html = [ [ "prettierd" "prettier" ] ];
css = [ [ "prettierd" "prettier" ] ];
javascript = [ [ "prettierd" "prettier" ] ];
javascriptreact = [ [ "prettierd" "prettier" ] ];
typescript = [ [ "prettierd" "prettier" ] ];
typescriptreact = [ [ "prettierd" "prettier" ] ];
python = [ "black" ];
lua = [ "stylua" ];
nix = [ "alejandra" ];
markdown = [ [ "prettierd" "prettier" ] ];
yaml = [ "yamllint" "yamlfmt" ];
};
};
};
}

View File

@@ -1,22 +0,0 @@
{ userModules, ... }: {
imports = [
"${userModules}/devtools/neovim/plugins/ai.nix"
"${userModules}/devtools/neovim/plugins/barbar.nix"
"${userModules}/devtools/neovim/plugins/comment.nix"
"${userModules}/devtools/neovim/plugins/conform.nix"
"${userModules}/devtools/neovim/plugins/efm.nix"
"${userModules}/devtools/neovim/plugins/floaterm.nix"
"${userModules}/devtools/neovim/plugins/harpoon.nix"
"${userModules}/devtools/neovim/plugins/lsp.nix"
"${userModules}/devtools/neovim/plugins/lualine.nix"
"${userModules}/devtools/neovim/plugins/markdown-preview.nix"
"${userModules}/devtools/neovim/plugins/neo-tree.nix"
"${userModules}/devtools/neovim/plugins/nonels.nix"
"${userModules}/devtools/neovim/plugins/startify.nix"
"${userModules}/devtools/neovim/plugins/tagbar.nix"
"${userModules}/devtools/neovim/plugins/telescope.nix"
"${userModules}/devtools/neovim/plugins/treesitter.nix"
"${userModules}/devtools/neovim/plugins/vimtex.nix"
"${userModules}/devtools/neovim/plugins/yanky.nix"
];
}

View File

@@ -1,19 +0,0 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.yanky;
in
{
options = {
modules.devtools.neovim.plugins.yanky.enable = mkEnableOption "Enables Yanky plugin for Neovim";
};
config = mkIf cfg.enable {
programs.nixvim.plugins.yanky = {
enable = true;
};
};
}

View File

@@ -6,7 +6,7 @@
...
}: let
inherit (lib) mkIf mkEnableOption;
cfg = config.modules.devtools.neovim;
cfg = config.modules.devtools.nixvim;
in {
imports = [
inputs.nixvim.homeManagerModules.nixvim
@@ -19,7 +19,7 @@ in {
];
options = {
modules.devtools.neovim.enable = mkEnableOption "Enable Neovim";
modules.devtools.nixvim.enable = mkEnableOption "Enable nixvim";
};
config = mkIf cfg.enable {

View File

@@ -1,14 +1,13 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.ai;
in
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.nixvim.plugins.ai;
in {
options = {
modules.devtools.neovim.plugins.ai.enable = mkEnableOption "Enables AI tools for Neovim";
modules.devtools.nixvim.plugins.ai.enable = mkEnableOption "Enables AI tools for nixvim";
};
config = mkIf cfg.enable {

View File

@@ -1,14 +1,13 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.barbar;
in
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.nixvim.plugins.barbar;
in {
options = {
modules.devtools.neovim.plugins.barbar.enable = mkEnableOption "Enables Barbar plugin for Neovim";
modules.devtools.nixvim.plugins.barbar.enable = mkEnableOption "Enables Barbar plugin for nixvim";
};
config = mkIf cfg.enable {

View File

@@ -1,14 +1,13 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.comment;
in
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.nixvim.plugins.comment;
in {
options = {
modules.devtools.neovim.plugins.comment.enable = mkEnableOption "Enables Comment plugin for Neovim";
modules.devtools.nixvim.plugins.comment.enable = mkEnableOption "Enables Comment plugin for nixvim";
};
config = mkIf cfg.enable {

View File

@@ -0,0 +1,37 @@
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.nixvim.plugins.conform-nvim;
in {
options = {
modules.devtools.nixvim.plugins.conform-nvim.enable = mkEnableOption "Enables Conform plugin for nixvim";
};
config = mkIf cfg.enable {
programs.nixvim.plugins.conform-nvim = {
enable = true;
formatOnSave = {
lspFallback = true;
timeoutMs = 500;
};
notifyOnError = true;
formattersByFt = {
liquidsoap = ["liquidsoap-prettier"];
html = [["prettierd" "prettier"]];
css = [["prettierd" "prettier"]];
javascript = [["prettierd" "prettier"]];
javascriptreact = [["prettierd" "prettier"]];
typescript = [["prettierd" "prettier"]];
typescriptreact = [["prettierd" "prettier"]];
python = ["black"];
lua = ["stylua"];
nix = ["alejandra"];
markdown = [["prettierd" "prettier"]];
yaml = ["yamllint" "yamlfmt"];
};
};
};
}

View File

@@ -0,0 +1,23 @@
{userModules, ...}: {
imports = [
"${userModules}/devtools/nixvim/plugins/ai.nix"
"${userModules}/devtools/nixvim/plugins/barbar.nix"
"${userModules}/devtools/nixvim/plugins/comment.nix"
"${userModules}/devtools/nixvim/plugins/conform.nix"
"${userModules}/devtools/nixvim/plugins/efm.nix"
"${userModules}/devtools/nixvim/plugins/floaterm.nix"
"${userModules}/devtools/nixvim/plugins/harpoon.nix"
"${userModules}/devtools/nixvim/plugins/lsp.nix"
"${userModules}/devtools/nixvim/plugins/lualine.nix"
"${userModules}/devtools/nixvim/plugins/markdown-preview.nix"
"${userModules}/devtools/nixvim/plugins/neo-tree.nix"
"${userModules}/devtools/nixvim/plugins/nonels.nix"
"${userModules}/devtools/nixvim/plugins/startify.nix"
"${userModules}/devtools/nixvim/plugins/tagbar.nix"
"${userModules}/devtools/nixvim/plugins/telescope.nix"
"${userModules}/devtools/nixvim/plugins/treesitter.nix"
"${userModules}/devtools/nixvim/plugins/vimtex.nix"
"${userModules}/devtools/nixvim/plugins/yanky.nix"
"${userModules}/devtools/nixvim/plugins/rustaceanvim.nix"
];
}

View File

@@ -1,14 +1,13 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.efm;
in
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.nixvim.plugins.efm;
in {
options = {
modules.devtools.neovim.plugins.efm.enable = mkEnableOption "Enables EFM LSP support for Neovim";
modules.devtools.nixvim.plugins.efm.enable = mkEnableOption "Enables EFM LSP support for nixvim";
};
config = mkIf cfg.enable {
@@ -27,7 +26,7 @@ in
lsp-format = {
enable = true;
lspServersToEnable = [ "efm" ];
lspServersToEnable = ["efm"];
};
efmls-configs.enable = true;

View File

@@ -1,14 +1,13 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.floaterm;
in
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.nixvim.plugins.floaterm;
in {
options = {
modules.devtools.neovim.plugins.floaterm.enable = mkEnableOption "Enables Floaterm plugin for Neovim";
modules.devtools.nixvim.plugins.floaterm.enable = mkEnableOption "Enables Floaterm plugin for nixvim";
};
config = mkIf cfg.enable {

View File

@@ -1,14 +1,13 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.harpoon;
in
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.nixvim.plugins.harpoon;
in {
options = {
modules.devtools.neovim.plugins.harpoon.enable = mkEnableOption "Enables Harpoon plugin for Neovim";
modules.devtools.nixvim.plugins.harpoon.enable = mkEnableOption "Enables Harpoon plugin for nixvim";
};
config = mkIf cfg.enable {

View File

@@ -4,11 +4,11 @@
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.lsp;
cfg = config.modules.devtools.nixvim.plugins.lsp;
in {
options = {
modules.devtools.neovim.plugins.lsp = {
enable = mkEnableOption "Enables LSP support for Neovim";
modules.devtools.nixvim.plugins.lsp = {
enable = mkEnableOption "Enables LSP support for nixvim";
servers = {
cssls.enable = mkEnableOption "Enable CSS LSP";
tailwindcss.enable = mkEnableOption "Enable TailwindCSS LSP";

View File

@@ -1,14 +1,13 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.lualine;
in
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.nixvim.plugins.lualine;
in {
options = {
modules.devtools.neovim.plugins.lualine.enable = mkEnableOption "Enables Lualine plugin for Neovim";
modules.devtools.nixvim.plugins.lualine.enable = mkEnableOption "Enables Lualine plugin for nixvim";
};
config = mkIf cfg.enable {
@@ -18,9 +17,9 @@ in
globalstatus = true;
sections = {
lualine_a = [ "mode" ];
lualine_b = [ "branch" ];
lualine_c = [ "filename" "diff" ];
lualine_a = ["mode"];
lualine_b = ["branch"];
lualine_c = ["filename" "diff"];
lualine_x = [
"diagnostics"

View File

@@ -1,14 +1,13 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.markdown-preview;
in
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.nixvim.plugins.markdown-preview;
in {
options = {
modules.devtools.neovim.plugins.markdown-preview.enable = mkEnableOption "Enables Markdown Preview plugin for Neovim";
modules.devtools.nixvim.plugins.markdown-preview.enable = mkEnableOption "Enables Markdown Preview plugin for nixvim";
};
config = mkIf cfg.enable {

View File

@@ -1,14 +1,13 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.neo-tree;
in
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.nixvim.plugins.neo-tree;
in {
options = {
modules.devtools.neovim.plugins.neo-tree.enable = mkEnableOption "Enables Neo-tree plugin for Neovim";
modules.devtools.nixvim.plugins.neo-tree.enable = mkEnableOption "Enables nix-tree plugin for nixvim";
};
config = mkIf cfg.enable {
@@ -27,7 +26,7 @@ in
{
mode = "n";
key = "<leader>n";
action = ":Neotree action=focus reveal toggle<CR>";
action = ":nixtree action=focus reveal toggle<CR>";
options.silent = true;
}
];

View File

@@ -1,21 +1,20 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.none-ls;
in
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.nixvim.plugins.none-ls;
in {
options = {
modules.devtools.neovim.plugins.none-ls.enable = mkEnableOption "Enables None-LS plugin for Neovim";
modules.devtools.nixvim.plugins.none-ls.enable = mkEnableOption "Enables None-LS plugin for nixvim";
};
config = mkIf cfg.enable {
programs.nixvim.plugins.none-ls = {
enable = true;
settings = {
cmd = [ "bash -c nvim" ];
cmd = ["bash -c nvim"];
debug = true;
};
sources = {

View File

@@ -0,0 +1,21 @@
{
lib,
pkgs,
config,
...
}:
with lib; let
cfg = config.modules.devtools.nixvim.plugins.rustaceanvim;
in {
options.modules.devtools.nixvim.plugins.rustaceanvim = {
enable = mkEnableOption "Whether to enable rustaceanvim.";
};
config = mkIf cfg.enable {
programs.nixvim = {
plugins = {
rustaceanvim.enable = true;
};
};
};
}

View File

@@ -1,14 +1,13 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.startify;
in
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.nixvim.plugins.startify;
in {
options = {
modules.devtools.neovim.plugins.startify.enable = mkEnableOption "Enables Startify plugin for Neovim";
modules.devtools.nixvim.plugins.startify.enable = mkEnableOption "Enables Startify plugin for nixvim";
};
config = mkIf cfg.enable {
@@ -28,9 +27,9 @@ in
change_to_dir = false;
use_unicode = true;
lists = [{ type = "dir"; }];
lists = [{type = "dir";}];
files_number = 30;
skiplist = [ "flake.lock" ];
skiplist = ["flake.lock"];
};
};
};

View File

@@ -1,14 +1,13 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.tagbar;
in
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.nixvim.plugins.tagbar;
in {
options = {
modules.devtools.neovim.plugins.tagbar.enable = mkEnableOption "Enables Tagbar plugin for Neovim";
modules.devtools.nixvim.plugins.tagbar.enable = mkEnableOption "Enables Tagbar plugin for nixvim";
};
config = mkIf cfg.enable {

View File

@@ -1,14 +1,13 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.telescope;
in
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.nixvim.plugins.telescope;
in {
options = {
modules.devtools.neovim.plugins.telescope.enable = mkEnableOption "Enables Telescope plugin for Neovim";
modules.devtools.nixvim.plugins.telescope.enable = mkEnableOption "Enables Telescope plugin for nixvim";
};
config = mkIf cfg.enable {

View File

@@ -1,15 +1,14 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.treesitter;
in
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.nixvim.plugins.treesitter;
in {
options = {
modules.devtools.neovim.plugins = {
treesitter.enable = mkEnableOption "Enables Treesitter plugin for Neovim";
modules.devtools.nixvim.plugins = {
treesitter.enable = mkEnableOption "Enables Treesitter plugin for nixvim";
};
};

View File

@@ -1,14 +1,13 @@
{ lib
, config
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.neovim.plugins.vimtex;
in
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.nixvim.plugins.vimtex;
in {
options = {
modules.devtools.neovim.plugins.vimtex.enable = mkEnableOption "Enables VimTeX plugin for Neovim";
modules.devtools.nixvim.plugins.vimtex.enable = mkEnableOption "Enables VimTeX plugin for nixvim";
};
config = mkIf cfg.enable {
@@ -27,7 +26,7 @@ in
];
toc_config = {
name = "TOC";
layers = [ "content" "todo" ];
layers = ["content" "todo"];
resize = true;
split_width = 50;
todo_sorted = false;
@@ -48,13 +47,13 @@ in
autoCmd = [
{
event = [ "BufEnter" "BufWinEnter" ];
event = ["BufEnter" "BufWinEnter"];
pattern = "*.tex";
command = "set filetype=tex \"| VimtexTocOpen";
}
{
event = "FileType";
pattern = [ "tex" "latex" ];
pattern = ["tex" "latex"];
callback = ''
function ()
vim.o.foldmethod = 'expr'

View File

@@ -0,0 +1,18 @@
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.modules.devtools.nixvim.plugins.yanky;
in {
options = {
modules.devtools.nixvim.plugins.yanky.enable = mkEnableOption "Enables Yanky plugin for nixvim";
};
config = mkIf cfg.enable {
programs.nixvim.plugins.yanky = {
enable = true;
};
};
}