flake: autodiscover plugin inputs

This commit is contained in:
raf 2024-04-08 03:28:49 +03:00
parent cf09a3bb8b
commit 859b03dfde
No known key found for this signature in database
GPG key ID: 02D1DD3FA08B6B29
8 changed files with 1439 additions and 1524 deletions

2329
flake.lock

File diff suppressed because it is too large Load diff

409
flake.nix
View file

@ -22,7 +22,7 @@
flake = { flake = {
lib = { lib = {
inherit (import ./lib/stdlib-extended.nix nixpkgs.lib) nvim; inherit (import ./lib/stdlib-extended.nix nixpkgs.lib inputs) nvim;
inherit (import ./configuration.nix inputs) neovimConfiguration; inherit (import ./configuration.nix inputs) neovimConfiguration;
}; };
@ -68,129 +68,6 @@
# TODO: get zig from the zig overlay instead of nixpkgs # TODO: get zig from the zig overlay instead of nixpkgs
zig.url = "github:mitchellh/zig-overlay"; zig.url = "github:mitchellh/zig-overlay";
# LSP plugins
nvim-lspconfig = {
# url = "github:neovim/nvim-lspconfig?ref=v0.1.3";
# Use master for nil_ls
url = "github:neovim/nvim-lspconfig";
flake = false;
};
lspsaga = {
url = "github:tami5/lspsaga.nvim";
flake = false;
};
lspkind = {
url = "github:onsails/lspkind-nvim";
flake = false;
};
trouble = {
url = "github:folke/trouble.nvim";
flake = false;
};
nvim-treesitter-context = {
url = "github:nvim-treesitter/nvim-treesitter-context";
flake = false;
};
nvim-lightbulb = {
url = "github:kosayoda/nvim-lightbulb";
flake = false;
};
nvim-code-action-menu = {
url = "github:weilbith/nvim-code-action-menu";
flake = false;
};
lsp-signature = {
url = "github:ray-x/lsp_signature.nvim";
flake = false;
};
lsp-lines = {
url = "sourcehut:~whynothugo/lsp_lines.nvim";
flake = false;
};
none-ls = {
# https://github.com/nvimtools/none-ls.nvim/issues/58
url = "github:nvimtools/none-ls.nvim/bb680d752cec37949faca7a1f509e2fe67ab418a";
flake = false;
};
nvim-docs-view = {
url = "github:amrbashir/nvim-docs-view";
flake = false;
};
# language support
sqls-nvim = {
url = "github:nanotee/sqls.nvim";
flake = false;
};
rust-tools = {
url = "github:simrat39/rust-tools.nvim";
flake = false;
};
flutter-tools = {
url = "github:akinsho/flutter-tools.nvim";
flake = false;
};
neodev-nvim = {
url = "github:folke/neodev.nvim";
flake = false;
};
elixir-ls = {
url = "github:elixir-lsp/elixir-ls";
flake = false;
};
elixir-tools = {
url = "github:elixir-tools/elixir-tools.nvim";
flake = false;
};
glow-nvim = {
url = "github:ellisonleao/glow.nvim";
flake = false;
};
image-nvim = {
url = "github:3rd/image.nvim";
flake = false;
};
# Tidal cycles
tidalcycles = {
url = "github:mitchmindtree/tidalcycles.nix";
inputs.vim-tidal-src.url = "github:tidalcycles/vim-tidal";
};
# Copying/Registers
registers = {
url = "github:tversteeg/registers.nvim";
flake = false;
};
nvim-neoclip = {
url = "github:AckslD/nvim-neoclip.lua";
flake = false;
};
# Telescope
telescope = {
url = "github:nvim-telescope/telescope.nvim";
flake = false;
};
# Langauge server (use master instead of nixpkgs) # Langauge server (use master instead of nixpkgs)
rnix-lsp.url = "github:nix-community/rnix-lsp"; rnix-lsp.url = "github:nix-community/rnix-lsp";
nil = { nil = {
@ -199,393 +76,521 @@
inputs.flake-utils.follows = "flake-utils"; inputs.flake-utils.follows = "flake-utils";
}; };
### Plugins
# Tidal cycles
tidalcycles = {
url = "github:mitchmindtree/tidalcycles.nix";
inputs.vim-tidal-src.url = "github:tidalcycles/vim-tidal";
};
# LSP plugins
plugin-nvim-lspconfig = {
# url = "github:neovim/nvim-lspconfig?ref=v0.1.3";
# Use master for nil_ls
url = "github:neovim/nvim-lspconfig";
flake = false;
};
plugin-lspsaga = {
url = "github:tami5/lspsaga.nvim";
flake = false;
};
plugin-lspkind = {
url = "github:onsails/lspkind-nvim";
flake = false;
};
plugin-trouble = {
url = "github:folke/trouble.nvim";
flake = false;
};
plugin-nvim-treesitter-context = {
url = "github:nvim-treesitter/nvim-treesitter-context";
flake = false;
};
plugin-nvim-lightbulb = {
url = "github:kosayoda/nvim-lightbulb";
flake = false;
};
plugin-nvim-code-action-menu = {
url = "github:weilbith/nvim-code-action-menu";
flake = false;
};
plugin-lsp-signature = {
url = "github:ray-x/lsp_signature.nvim";
flake = false;
};
plugin-lsp-lines = {
url = "sourcehut:~whynothugo/lsp_lines.nvim";
flake = false;
};
plugin-none-ls = {
# https://github.com/nvimtools/none-ls.nvim/issues/58
url = "github:nvimtools/none-ls.nvim/bb680d752cec37949faca7a1f509e2fe67ab418a";
flake = false;
};
plugin-nvim-docs-view = {
url = "github:amrbashir/nvim-docs-view";
flake = false;
};
# language support
plugin-sqls-nvim = {
url = "github:nanotee/sqls.nvim";
flake = false;
};
plugin-rust-tools = {
url = "github:simrat39/rust-tools.nvim";
flake = false;
};
plugin-flutter-tools = {
url = "github:akinsho/flutter-tools.nvim";
flake = false;
};
plugin-neodev-nvim = {
url = "github:folke/neodev.nvim";
flake = false;
};
plugin-elixir-ls = {
url = "github:elixir-lsp/elixir-ls";
flake = false;
};
plugin-elixir-tools = {
url = "github:elixir-tools/elixir-tools.nvim";
flake = false;
};
plugin-glow-nvim = {
url = "github:ellisonleao/glow.nvim";
flake = false;
};
plugin-image-nvim = {
url = "github:3rd/image.nvim";
flake = false;
};
# Copying/Registers
plugin-registers = {
url = "github:tversteeg/registers.nvim";
flake = false;
};
plugin-nvim-neoclip = {
url = "github:AckslD/nvim-neoclip.lua";
flake = false;
};
# Telescope
plugin-telescope = {
url = "github:nvim-telescope/telescope.nvim";
flake = false;
};
# Debuggers # Debuggers
nvim-dap = { plugin-nvim-dap = {
url = "github:mfussenegger/nvim-dap"; url = "github:mfussenegger/nvim-dap";
flake = false; flake = false;
}; };
nvim-dap-ui = { plugin-nvim-dap-ui = {
url = "github:rcarriga/nvim-dap-ui"; url = "github:rcarriga/nvim-dap-ui";
flake = false; flake = false;
}; };
# Filetrees # Filetrees
nvim-tree-lua = { plugin-nvim-tree-lua = {
url = "github:nvim-tree/nvim-tree.lua"; url = "github:nvim-tree/nvim-tree.lua";
flake = false; flake = false;
}; };
# Tablines # Tablines
nvim-bufferline-lua = { plugin-nvim-bufferline-lua = {
url = "github:akinsho/nvim-bufferline.lua"; url = "github:akinsho/nvim-bufferline.lua";
flake = false; flake = false;
}; };
# Statuslines # Statuslines
lualine = { plugin-lualine = {
url = "github:hoob3rt/lualine.nvim"; url = "github:hoob3rt/lualine.nvim";
flake = false; flake = false;
}; };
nvim-cmp = { plugin-nvim-cmp = {
url = "github:hrsh7th/nvim-cmp"; url = "github:hrsh7th/nvim-cmp";
flake = false; flake = false;
}; };
cmp-buffer = {
plugin-cmp-buffer = {
url = "github:hrsh7th/cmp-buffer"; url = "github:hrsh7th/cmp-buffer";
flake = false; flake = false;
}; };
cmp-nvim-lsp = {
plugin-cmp-nvim-lsp = {
url = "github:hrsh7th/cmp-nvim-lsp"; url = "github:hrsh7th/cmp-nvim-lsp";
flake = false; flake = false;
}; };
cmp-vsnip = {
plugin-cmp-vsnip = {
url = "github:hrsh7th/cmp-vsnip"; url = "github:hrsh7th/cmp-vsnip";
flake = false; flake = false;
}; };
cmp-path = {
plugin-cmp-path = {
url = "github:hrsh7th/cmp-path"; url = "github:hrsh7th/cmp-path";
flake = false; flake = false;
}; };
cmp-treesitter = {
plugin-cmp-treesitter = {
url = "github:ray-x/cmp-treesitter"; url = "github:ray-x/cmp-treesitter";
flake = false; flake = false;
}; };
# snippets # snippets
vim-vsnip = { plugin-vim-vsnip = {
url = "github:hrsh7th/vim-vsnip"; url = "github:hrsh7th/vim-vsnip";
flake = false; flake = false;
}; };
# Presence # Presence
neocord = { plugin-neocord = {
url = "github:IogaMaster/neocord"; url = "github:IogaMaster/neocord";
flake = false; # uses flake-utils, avoid the flake flake = false; # uses flake-utils, avoid the flake
}; };
# Autopairs # Autopairs
nvim-autopairs = { plugin-nvim-autopairs = {
url = "github:windwp/nvim-autopairs"; url = "github:windwp/nvim-autopairs";
flake = false; flake = false;
}; };
nvim-ts-autotag = {
plugin-nvim-ts-autotag = {
url = "github:windwp/nvim-ts-autotag"; url = "github:windwp/nvim-ts-autotag";
flake = false; flake = false;
}; };
# Commenting # Commenting
kommentary = { plugin-comment-nvim = {
url = "github:b3nj5m1n/kommentary";
flake = false;
};
comment-nvim = {
url = "github:numToStr/Comment.nvim"; url = "github:numToStr/Comment.nvim";
flake = false; flake = false;
}; };
todo-comments = { plugin-todo-comments = {
url = "github:folke/todo-comments.nvim"; url = "github:folke/todo-comments.nvim";
flake = false; flake = false;
}; };
# Buffer tools # Buffer tools
bufdelete-nvim = { plugin-bufdelete-nvim = {
url = "github:famiu/bufdelete.nvim"; url = "github:famiu/bufdelete.nvim";
flake = false; flake = false;
}; };
# Dashboard Utilities # Dashboard Utilities
dashboard-nvim = { plugin-dashboard-nvim = {
url = "github:glepnir/dashboard-nvim"; url = "github:glepnir/dashboard-nvim";
flake = false; flake = false;
}; };
alpha-nvim = { plugin-alpha-nvim = {
url = "github:goolord/alpha-nvim"; url = "github:goolord/alpha-nvim";
flake = false; flake = false;
}; };
vim-startify = { plugin-vim-startify = {
url = "github:mhinz/vim-startify"; url = "github:mhinz/vim-startify";
flake = false; flake = false;
}; };
# Themes # Themes
tokyonight = { plugin-tokyonight = {
url = "github:folke/tokyonight.nvim"; url = "github:folke/tokyonight.nvim";
flake = false; flake = false;
}; };
onedark = { plugin-onedark = {
url = "github:navarasu/onedark.nvim"; url = "github:navarasu/onedark.nvim";
flake = false; flake = false;
}; };
catppuccin = { plugin-catppuccin = {
url = "github:catppuccin/nvim"; url = "github:catppuccin/nvim";
flake = false; flake = false;
}; };
dracula = { plugin-dracula = {
url = "github:Mofiqul/dracula.nvim"; url = "github:Mofiqul/dracula.nvim";
flake = false; flake = false;
}; };
oxocarbon = { plugin-oxocarbon = {
url = "github:glyh/oxocarbon.nvim/lualine-support"; url = "github:glyh/oxocarbon.nvim/lualine-support";
flake = false; flake = false;
}; };
gruvbox = { plugin-gruvbox = {
url = "github:ellisonleao/gruvbox.nvim"; url = "github:ellisonleao/gruvbox.nvim";
flake = false; flake = false;
}; };
rose-pine = { plugin-rose-pine = {
url = "github:rose-pine/neovim"; url = "github:rose-pine/neovim";
flake = false; flake = false;
}; };
# Rust crates # Rust crates
crates-nvim = { plugin-crates-nvim = {
url = "github:Saecki/crates.nvim"; url = "github:Saecki/crates.nvim";
flake = false; flake = false;
}; };
# Project Management # Project Management
project-nvim = { plugin-project-nvim = {
url = "github:ahmedkhalf/project.nvim"; url = "github:ahmedkhalf/project.nvim";
flake = false; flake = false;
}; };
# Visuals # Visuals
nvim-cursorline = { plugin-nvim-cursorline = {
url = "github:yamatsum/nvim-cursorline"; url = "github:yamatsum/nvim-cursorline";
flake = false; flake = false;
}; };
scrollbar-nvim = { plugin-scrollbar-nvim = {
url = "github:petertriho/nvim-scrollbar"; url = "github:petertriho/nvim-scrollbar";
flake = false; flake = false;
}; };
cinnamon-nvim = { plugin-cinnamon-nvim = {
url = "github:declancm/cinnamon.nvim"; url = "github:declancm/cinnamon.nvim";
flake = false; flake = false;
}; };
cellular-automaton = { plugin-cellular-automaton = {
url = "github:Eandrju/cellular-automaton.nvim"; url = "github:Eandrju/cellular-automaton.nvim";
flake = false; flake = false;
}; };
indent-blankline = { plugin-indent-blankline = {
url = "github:lukas-reineke/indent-blankline.nvim"; url = "github:lukas-reineke/indent-blankline.nvim";
flake = false; flake = false;
}; };
nvim-web-devicons = {
plugin-nvim-web-devicons = {
url = "github:nvim-tree/nvim-web-devicons"; url = "github:nvim-tree/nvim-web-devicons";
flake = false; flake = false;
}; };
gitsigns-nvim = {
plugin-gitsigns-nvim = {
url = "github:lewis6991/gitsigns.nvim"; url = "github:lewis6991/gitsigns.nvim";
flake = false; flake = false;
}; };
fidget-nvim = { plugin-fidget-nvim = {
url = "github:j-hui/fidget.nvim"; url = "github:j-hui/fidget.nvim";
flake = false; flake = false;
}; };
highlight-undo = { plugin-highlight-undo = {
url = "github:tzachar/highlight-undo.nvim"; url = "github:tzachar/highlight-undo.nvim";
flake = false; flake = false;
}; };
# Minimap # Minimap
minimap-vim = { plugin-minimap-vim = {
url = "github:wfxr/minimap.vim"; url = "github:wfxr/minimap.vim";
flake = false; flake = false;
}; };
codewindow-nvim = { plugin-codewindow-nvim = {
url = "github:gorbit99/codewindow.nvim"; url = "github:gorbit99/codewindow.nvim";
flake = false; flake = false;
}; };
# Notifications # Notifications
nvim-notify = { plugin-nvim-notify = {
url = "github:rcarriga/nvim-notify"; url = "github:rcarriga/nvim-notify";
flake = false; flake = false;
}; };
# Utilities # Utilities
ccc = { plugin-ccc = {
url = "github:uga-rosa/ccc.nvim"; url = "github:uga-rosa/ccc.nvim";
flake = false; flake = false;
}; };
diffview-nvim = { plugin-diffview-nvim = {
url = "github:sindrets/diffview.nvim"; url = "github:sindrets/diffview.nvim";
flake = false; flake = false;
}; };
icon-picker-nvim = { plugin-icon-picker-nvim = {
url = "github:ziontee113/icon-picker.nvim"; url = "github:ziontee113/icon-picker.nvim";
flake = false; flake = false;
}; };
which-key = { plugin-which-key = {
url = "github:folke/which-key.nvim"; url = "github:folke/which-key.nvim";
flake = false; flake = false;
}; };
cheatsheet-nvim = { plugin-cheatsheet-nvim = {
url = "github:sudormrfbin/cheatsheet.nvim"; url = "github:sudormrfbin/cheatsheet.nvim";
flake = false; flake = false;
}; };
gesture-nvim = { plugin-gesture-nvim = {
url = "github:notomo/gesture.nvim"; url = "github:notomo/gesture.nvim";
flake = false; flake = false;
}; };
hop-nvim = { plugin-hop-nvim = {
url = "github:phaazon/hop.nvim"; url = "github:phaazon/hop.nvim";
flake = false; flake = false;
}; };
leap-nvim = { plugin-leap-nvim = {
url = "github:ggandor/leap.nvim"; url = "github:ggandor/leap.nvim";
flake = false; flake = false;
}; };
smartcolumn = { plugin-smartcolumn = {
url = "github:m4xshen/smartcolumn.nvim"; url = "github:m4xshen/smartcolumn.nvim";
flake = false; flake = false;
}; };
nvim-surround = { plugin-nvim-surround = {
url = "github:kylechui/nvim-surround"; url = "github:kylechui/nvim-surround";
flake = false; flake = false;
}; };
# Note-taking # Note-taking
obsidian-nvim = { plugin-obsidian-nvim = {
url = "github:epwalsh/obsidian.nvim"; url = "github:epwalsh/obsidian.nvim";
flake = false; flake = false;
}; };
orgmode-nvim = { plugin-orgmode-nvim = {
url = "github:nvim-orgmode/orgmode"; url = "github:nvim-orgmode/orgmode";
flake = false; flake = false;
}; };
mind-nvim = { plugin-mind-nvim = {
url = "github:phaazon/mind.nvim"; url = "github:phaazon/mind.nvim";
flake = false; flake = false;
}; };
# Spellchecking # Spellchecking
vim-dirtytalk = { plugin-vim-dirtytalk = {
url = "github:psliwka/vim-dirtytalk"; url = "github:psliwka/vim-dirtytalk";
flake = false; flake = false;
}; };
# Terminal # Terminal
toggleterm-nvim = { plugin-toggleterm-nvim = {
url = "github:akinsho/toggleterm.nvim"; url = "github:akinsho/toggleterm.nvim";
flake = false; flake = false;
}; };
# UI # UI
nvim-navbuddy = { plugin-nvim-navbuddy = {
url = "github:SmiteshP/nvim-navbuddy"; url = "github:SmiteshP/nvim-navbuddy";
flake = false; flake = false;
}; };
nvim-navic = { plugin-nvim-navic = {
url = "github:SmiteshP/nvim-navic"; url = "github:SmiteshP/nvim-navic";
flake = false; flake = false;
}; };
noice-nvim = { plugin-noice-nvim = {
url = "github:folke/noice.nvim"; url = "github:folke/noice.nvim";
flake = false; flake = false;
}; };
modes-nvim = { plugin-modes-nvim = {
url = "github:mvllow/modes.nvim"; url = "github:mvllow/modes.nvim";
flake = false; flake = false;
}; };
nvim-colorizer-lua = { plugin-nvim-colorizer-lua = {
url = "github:NvChad/nvim-colorizer.lua"; url = "github:NvChad/nvim-colorizer.lua";
flake = false; flake = false;
}; };
vim-illuminate = { plugin-vim-illuminate = {
url = "github:RRethy/vim-illuminate"; url = "github:RRethy/vim-illuminate";
flake = false; flake = false;
}; };
# Assistant # Assistant
copilot-lua = { plugin-copilot-lua = {
url = "github:zbirenbaum/copilot.lua"; url = "github:zbirenbaum/copilot.lua";
flake = false; flake = false;
}; };
copilot-cmp = { plugin-copilot-cmp = {
url = "github:zbirenbaum/copilot-cmp"; url = "github:zbirenbaum/copilot-cmp";
flake = false; flake = false;
}; };
# Session management # Session management
nvim-session-manager = { plugin-nvim-session-manager = {
url = "github:Shatur/neovim-session-manager"; url = "github:Shatur/neovim-session-manager";
flake = false; flake = false;
}; };
# Dependencies # Dependencies
plenary-nvim = { plugin-plenary-nvim = {
# (required by crates-nvim) # (required by crates-nvim)
url = "github:nvim-lua/plenary.nvim"; url = "github:nvim-lua/plenary.nvim";
flake = false; flake = false;
}; };
dressing-nvim = { plugin-dressing-nvim = {
# (required by icon-picker-nvim) # (required by icon-picker-nvim)
url = "github:stevearc/dressing.nvim"; url = "github:stevearc/dressing.nvim";
flake = false; flake = false;
}; };
vim-markdown = { plugin-vim-markdown = {
# (required by obsidian-nvim) # (required by obsidian-nvim)
url = "github:preservim/vim-markdown"; url = "github:preservim/vim-markdown";
flake = false; flake = false;
}; };
tabular = { plugin-tabular = {
# (required by vim-markdown) # (required by vim-markdown)
url = "github:godlygeek/tabular"; url = "github:godlygeek/tabular";
flake = false; flake = false;
}; };
nui-nvim = { plugin-nui-nvim = {
# (required by noice.nvim) # (required by noice.nvim)
url = "github:MunifTanjim/nui.nvim"; url = "github:MunifTanjim/nui.nvim";
flake = false; flake = false;
}; };
vim-repeat = { plugin-vim-repeat = {
# (required by leap.nvim)
url = "github:tpope/vim-repeat"; url = "github:tpope/vim-repeat";
flake = false; flake = false;
}; };
nvim-nio = { plugin-nvim-nio = {
# (required nvim-dap-ui) # (required nvim-dap-ui)
url = "github:nvim-neotest/nvim-nio"; url = "github:nvim-neotest/nvim-nio";
flake = false; flake = false;

View file

@ -1,5 +1,9 @@
{lib}: { {
types = import ./types {inherit lib;}; inputs,
lib,
...
}: {
types = import ./types {inherit inputs lib;};
config = import ./config.nix {inherit lib;}; config = import ./config.nix {inherit lib;};
binds = import ./binds.nix {inherit lib;}; binds = import ./binds.nix {inherit lib;};

View file

@ -1,6 +1,6 @@
# Cconvenience function that returns the given Nixpkgs standard library # Cconvenience function that returns the given Nixpkgs standard library
# extended with our functions using `lib.extend`. # extended with our functions using `lib.extend`.
nixpkgsLib: let nixpkgsLib: inputs: let
mkNvimLib = import ./.; mkNvimLib = import ./.;
in in
# WARNING: New functions should not be added here, but to files # WARNING: New functions should not be added here, but to files
@ -8,7 +8,10 @@ in
# function does not fit to any of the existing categories, create # function does not fit to any of the existing categories, create
# a new file and import it in `./default.nix.` # a new file and import it in `./default.nix.`
nixpkgsLib.extend (self: super: { nixpkgsLib.extend (self: super: {
nvim = mkNvimLib {lib = self;}; nvim = mkNvimLib {
inherit inputs;
lib = self;
};
# For forward compatibility. # For forward compatibility.
literalExpression = super.literalExpression or super.literalExample; literalExpression = super.literalExpression or super.literalExample;

View file

@ -1,5 +1,5 @@
# From home-manager: https://github.com/nix-community/home-manager/blob/master/modules/lib/types-dag.nix # From home-manager: https://github.com/nix-community/home-manager/blob/master/modules/lib/types-dag.nix
# Used for ordering config text. # Used for ordering configuration text.
{lib}: let {lib}: let
inherit inherit
(lib) (lib)
@ -59,8 +59,8 @@ in rec {
name = "dagOf"; name = "dagOf";
description = "DAG of ${elemType.description}"; description = "DAG of ${elemType.description}";
inherit (attrEquivalent) check merge emptyValue; inherit (attrEquivalent) check merge emptyValue;
inherit (elemType) getSubModules;
getSubOptions = prefix: elemType.getSubOptions (prefix ++ ["<name>"]); getSubOptions = prefix: elemType.getSubOptions (prefix ++ ["<name>"]);
getSubModules = elemType.getSubModules;
substSubModules = m: dagOf (elemType.substSubModules m); substSubModules = m: dagOf (elemType.substSubModules m);
functor = (defaultFunctor name) // {wrapped = elemType;}; functor = (defaultFunctor name) // {wrapped = elemType;};
nestedTypes.elemType = elemType; nestedTypes.elemType = elemType;

View file

@ -1,6 +1,10 @@
{lib}: let {
inputs,
lib,
...
}: let
typesDag = import ./dag.nix {inherit lib;}; typesDag = import ./dag.nix {inherit lib;};
typesPlugin = import ./plugins.nix {inherit lib;}; typesPlugin = import ./plugins.nix {inherit inputs lib;};
typesLanguage = import ./languages.nix {inherit lib;}; typesLanguage = import ./languages.nix {inherit lib;};
in { in {
inherit (typesDag) dagOf; inherit (typesDag) dagOf;

View file

@ -1,137 +1,51 @@
{lib}: {
with lib; let inputs,
# Plugin must be same as input name from flake.nix lib,
availablePlugins = [ ...
# TODO: sort by category }: let
"nvim-treesitter-context" inherit (lib.options) mkOption;
"gitsigns-nvim" inherit (lib.attrsets) attrNames mapAttrs' filterAttrs nameValuePair;
"plenary-nvim" inherit (lib.strings) hasPrefix removePrefix isString;
"nvim-lspconfig" inherit (lib.types) submodule either package enum str lines attrsOf anything listOf nullOr;
"nvim-treesitter"
"lspsaga" # Get the names of all flake inputs that start with the given prefix.
"lspkind" fromInputs = inputs: prefix:
"nvim-lightbulb" mapAttrs' (n: v: nameValuePair (removePrefix prefix n) {src = v;}) (filterAttrs (n: _: hasPrefix prefix n) inputs);
"lsp-signature"
"nvim-tree-lua" pluginsFromInputs = attrNames (fromInputs inputs "plugin-");
"nvim-bufferline-lua"
"lualine" # Get the names of all flake inputs that start with the given prefix.
"nvim-autopairs"
"nvim-ts-autotag"
"nvim-web-devicons"
"tokyonight"
"bufdelete-nvim"
"nvim-cmp"
"cmp-nvim-lsp"
"cmp-buffer"
"cmp-vsnip"
"cmp-path"
"cmp-treesitter"
"crates-nvim"
"vim-vsnip"
"nvim-code-action-menu"
"trouble"
"none-ls"
"which-key"
"indent-blankline"
"nvim-cursorline"
"sqls-nvim"
"glow-nvim"
"telescope"
"rust-tools"
"onedark"
"catppuccin"
"dracula"
"oxocarbon"
"gruvbox"
"rose-pine"
"minimap-vim"
"dashboard-nvim"
"alpha-nvim"
"scrollbar-nvim"
"codewindow-nvim"
"nvim-notify"
"cinnamon-nvim"
"cheatsheet-nvim"
"ccc"
"cellular-automaton"
"neocord"
"icon-picker-nvim"
"dressing-nvim"
"orgmode-nvim"
"obsidian-nvim"
"vim-markdown"
"tabular"
"toggleterm-nvim"
"noice-nvim"
"nui-nvim"
"copilot-lua"
"tabnine-nvim"
"nvim-session-manager"
"gesture-nvim"
"comment-nvim"
"kommentary"
"mind-nvim"
"fidget-nvim"
"diffview-nvim"
"todo-comments"
"flutter-tools"
"flutter-tools-patched"
"hop-nvim"
"leap-nvim"
"modes-nvim"
"vim-repeat"
"smartcolumn"
"project-nvim"
"neodev-nvim"
"elixir-ls"
"elixir-tools"
"nvim-colorizer-lua"
"vim-illuminate"
"nvim-surround"
"nvim-dap"
"nvim-dap-ui"
"nvim-navic"
"nvim-navbuddy"
"copilot-cmp"
"lsp-lines"
"vim-dirtytalk"
"highlight-undo"
"nvim-docs-view"
"image-nvim"
"nvim-nio"
];
# You can either use the name of the plugin or a package. # You can either use the name of the plugin or a package.
pluginType = with types; pluginType = nullOr (
nullOr ( either
either package
package (enum (pluginsFromInputs ++ ["nvim-treesitter" "flutter-tools-patched" "vim-repeat"]))
(enum availablePlugins) );
);
pluginsType = types.listOf pluginType; pluginsType = listOf pluginType;
extraPluginType = with types; extraPluginType = submodule {
submodule { options = {
options = { package = mkOption {
package = mkOption { type = pluginType;
type = pluginType; description = "Plugin Package.";
description = "Plugin Package."; };
};
after = mkOption { after = mkOption {
type = listOf str; type = listOf str;
default = []; default = [];
description = "Setup this plugin after the following ones."; description = "Setup this plugin after the following ones.";
}; };
setup = mkOption { setup = mkOption {
type = lines; type = lines;
default = ""; default = "";
description = "Lua code to run during setup."; description = "Lua code to run during setup.";
example = "require('aerial').setup {}"; example = "require('aerial').setup {}";
};
}; };
}; };
};
in { in {
inherit extraPluginType; inherit extraPluginType;
@ -156,23 +70,25 @@ in {
lib.mergeOneOption val defs; lib.mergeOneOption val defs;
}; };
# opts is a attrset of options, example: /*
# ``` opts is a attrset of options, example:
# mkPluginSetupOption "telescope" { ```
# file_ignore_patterns = mkOption { mkPluginSetupOption "telescope" {
# description = "..."; file_ignore_patterns = mkOption {
# type = types.listOf types.str; description = "...";
# default = []; type = types.listOf types.str;
# }; default = [];
# layout_config.horizontal = mkOption {...}; };
# } layout_config.horizontal = mkOption {...};
# ``` }
```
*/
mkPluginSetupOption = pluginName: opts: mkPluginSetupOption = pluginName: opts:
mkOption { mkOption {
description = "Option table to pass into the setup function of " + pluginName; description = "Option table to pass into the setup function of " + pluginName;
default = {}; default = {};
type = types.submodule { type = submodule {
freeformType = with types; attrsOf anything; freeformType = attrsOf anything;
options = opts; options = opts;
}; };
}; };

View file

@ -11,7 +11,7 @@ inputs: {
inherit (pkgs.neovimUtils) makeNeovimConfig; inherit (pkgs.neovimUtils) makeNeovimConfig;
inherit (lib.attrsets) recursiveUpdate; inherit (lib.attrsets) recursiveUpdate;
extendedLib = import ../lib/stdlib-extended.nix lib; extendedLib = import ../lib/stdlib-extended.nix lib inputs;
nvimModules = import ./modules.nix { nvimModules = import ./modules.nix {
inherit check pkgs; inherit check pkgs;