mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-02-12 20:13:19 +00:00
Merge branch 'main' into add-nixd-opts
This commit is contained in:
commit
6d7b8ec2f1
60 changed files with 2915 additions and 4046 deletions
|
@ -26,3 +26,6 @@ trim_trailing_whitespace = unset
|
|||
|
||||
[*.lock]
|
||||
indent_size = unset
|
||||
|
||||
[npins/sources.json]
|
||||
insert_final_newline = unset
|
||||
|
|
3
.github/typos.toml
vendored
3
.github/typos.toml
vendored
|
@ -1,2 +1,5 @@
|
|||
|
||||
default.extend-ignore-words-re = ["(?i)(noice)", "befores", "annote", "viw"]
|
||||
files.extend-exclude = [
|
||||
"npins/sources.json"
|
||||
]
|
||||
|
|
1
.github/workflows/cachix.yml
vendored
1
.github/workflows/cachix.yml
vendored
|
@ -35,7 +35,6 @@ jobs:
|
|||
|
||||
- name: Install Nix
|
||||
uses: DeterminateSystems/nix-installer-action@main
|
||||
- uses: DeterminateSystems/magic-nix-cache-action@main
|
||||
|
||||
- uses: cachix/cachix-action@v15
|
||||
with:
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
```{=include=} chapters
|
||||
configuring/custom-package.md
|
||||
configuring/custom-plugins.md
|
||||
configuring/custom-inputs.md
|
||||
configuring/overriding-plugins.md
|
||||
configuring/languages.md
|
||||
configuring/dags.md
|
||||
configuring/dag-entries.md
|
||||
|
|
|
@ -1,53 +0,0 @@
|
|||
# Custom Inputs {#ch-custom-inputs}
|
||||
|
||||
One of the greatest strengths of **nvf** is its ability to get plugins from
|
||||
flake inputs and build them locally from any given source. For plugins that do
|
||||
not require any kind of additional building step, this is a powerful method of
|
||||
adding plugins to your configuration that are not packaged in nixpkgs, or those
|
||||
you want to track from source without relying on nixpkgs.
|
||||
|
||||
The [additional plugins section](#sec-additional-plugins) details the addition
|
||||
of new plugins to nvf under regular circumstances, i.e. while making a pull
|
||||
request to the project. You may _override_ those plugin inputs in your own
|
||||
`flake.nix` to change source versions, e.g., to use newer versions of plugins
|
||||
that are not yet updated in **nvf**.
|
||||
|
||||
```nix
|
||||
{
|
||||
|
||||
inputs = {
|
||||
# ...
|
||||
|
||||
# The name here is arbitrary, you can name it whatever.
|
||||
# This will add a plugin input called "your-neodev-input"
|
||||
# that you can reference in a `follows` line.
|
||||
your-neodev-input = {
|
||||
url = "github:folke/neodev.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
nvf = {
|
||||
url = "github:notashelf/nvf";
|
||||
|
||||
# The name of the input must match for the follows line
|
||||
# plugin-neodev-nvim is what the input is called inside nvf
|
||||
# so you must match the exact name here.
|
||||
inputs.plugin-neodev-nvim.follows = "your-neodev-input";
|
||||
};
|
||||
# ...
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
This will override the source for the `neodev.nvim` plugin that is used in nvf
|
||||
with your own input. You can update your new input via `nix flake update` or
|
||||
more specifically `nix flake update <name of your input>` to keep it up to date.
|
||||
|
||||
::: {.warning}
|
||||
|
||||
While updating plugin inputs, make sure that any configuration that has been
|
||||
deprecated in newer versions is changed in the plugin's `setupOpts`. If you
|
||||
depend on a new version, requesting a version bump in the issues section is a
|
||||
more reliable option.
|
||||
|
||||
:::
|
35
docs/manual/configuring/overriding-plugins.md
Normal file
35
docs/manual/configuring/overriding-plugins.md
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Overriding plugins {#ch-overriding-plugins}
|
||||
|
||||
The [additional plugins section](#sec-additional-plugins) details the addition
|
||||
of new plugins to nvf under regular circumstances, i.e. while making a pull
|
||||
request to the project. You may _override_ those plugins in your config
|
||||
to change source versions, e.g., to use newer versions of plugins
|
||||
that are not yet updated in **nvf**.
|
||||
|
||||
```nix
|
||||
vim.pluginOverrides = {
|
||||
lazydev-nvim = pkgs.fetchFromGitHub {
|
||||
owner = "folke";
|
||||
repo = "lazydev.nvim";
|
||||
rev = "";
|
||||
hash = "";
|
||||
};
|
||||
# It's also possible to use a flake input
|
||||
lazydev-nvim = inputs.lazydev-nvim;
|
||||
# Or a local path
|
||||
lazydev-nvim = ./lazydev;
|
||||
# Or a npins pin... etc
|
||||
};
|
||||
```
|
||||
|
||||
This will override the source for the `neodev.nvim` plugin that is used in nvf
|
||||
with your own plugin.
|
||||
|
||||
::: {.warning}
|
||||
|
||||
While updating plugin inputs, make sure that any configuration that has been
|
||||
deprecated in newer versions is changed in the plugin's `setupOpts`. If you
|
||||
depend on a new version, requesting a version bump in the issues section is a
|
||||
more reliable option.
|
||||
|
||||
:::
|
|
@ -1,36 +1,25 @@
|
|||
# Adding Plugins {#sec-additional-plugins}
|
||||
|
||||
To add a new Neovim plugin, first add the source url in the inputs section of
|
||||
`flake.nix` with the prefix `plugin-`
|
||||
To add a new Neovim plugin, use `npins`
|
||||
|
||||
Use:
|
||||
|
||||
`nix-shell -p npins` or `nix shell nixpkgs#npins`
|
||||
|
||||
Then run:
|
||||
|
||||
`npins add --name <plugin name> github <owner> <repo> -b <branch>`
|
||||
|
||||
Be sure to replace any non-alphanumeric characters with `-` for `--name`
|
||||
|
||||
For example
|
||||
|
||||
`npins add --name lazydev-nvim github folke lazydev.nvim -b main`
|
||||
|
||||
You can now reference this plugin as a **string**.
|
||||
|
||||
```nix
|
||||
{
|
||||
inputs = {
|
||||
# ...
|
||||
plugin-neodev-nvim = {
|
||||
url = "github:folke/neodev.nvim";
|
||||
flake = false;
|
||||
};
|
||||
# ...
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
Prepending `plugin-` to the name of the input will allow nvf to automatically
|
||||
discover inputs that are marked as plugins, and make them available in
|
||||
`vim.startPlugins` or other areas that require a very specific plugin type as it
|
||||
is defined in `@NVF_REPO@/lib/types/plugins.nix`
|
||||
|
||||
The addition of the `plugin-` prefix will allow **nvf** to autodiscover the
|
||||
input from the flake inputs automatically, allowing you to refer to it in areas
|
||||
that require a very specific plugin type as defined in `lib/types/plugins.nix`
|
||||
|
||||
You can now reference this plugin using its string name, the plugin will be
|
||||
built with the name and source URL from the flake input, allowing you to refer
|
||||
to it as a **string**.
|
||||
|
||||
```nix
|
||||
config.vim.startPlugins = ["neodev-nvim"];
|
||||
config.vim.startPlugins = ["lazydev-nvim"];
|
||||
```
|
||||
|
||||
## Modular setup options {#sec-modular-setup-options}
|
||||
|
|
|
@ -23,15 +23,17 @@ An example flake that exposes your custom Neovim configuration might look like
|
|||
nvf.url = "github:notashelf/nvf";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
...
|
||||
} @ inputs: {
|
||||
packages."x86_64-linux" = let
|
||||
neovimConfigured = (inputs.nvf.lib.neovimConfiguration {
|
||||
inherit (nixpkgs.legacyPackages."x86_64-linux") pkgs;
|
||||
modules = [{
|
||||
outputs = {nixpkgs, ...} @ inputs: {
|
||||
packages.x86_64-linux = {
|
||||
# Set the default package to the wrapped instance of Neovim.
|
||||
# This will allow running your Neovim configuration with
|
||||
# `nix run` and in addition, sharing your configuration with
|
||||
# other users in case your repository is public.
|
||||
default =
|
||||
(inputs.nvf.lib.neovimConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
modules = [
|
||||
{
|
||||
config.vim = {
|
||||
# Enable custom theming options
|
||||
theme.enable = true;
|
||||
|
@ -43,14 +45,10 @@ An example flake that exposes your custom Neovim configuration might look like
|
|||
# reference in Appendix B of the nvf manual.
|
||||
# ...
|
||||
};
|
||||
}];
|
||||
});
|
||||
in {
|
||||
# Set the default package to the wrapped instance of Neovim.
|
||||
# This will allow running your Neovim configuration with
|
||||
# `nix run` and in addition, sharing your configuration with
|
||||
# other users in case your repository is public.
|
||||
default = neovimConfigured.neovim;
|
||||
}
|
||||
];
|
||||
})
|
||||
.neovim;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -49,13 +49,10 @@ Followed by importing the home-manager module somewhere in your configuration.
|
|||
nvf.url = "github:notashelf/nvf";
|
||||
};
|
||||
|
||||
outputs = { nixpkgs, home-manager, nvf, ... }: let
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in {
|
||||
outputs = { nixpkgs, home-manager, nvf, ... }: {
|
||||
# ↓ this is your home output in the flake schema, expected by home-manager
|
||||
"your-username@your-hostname" = home-manager.lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
modules = [
|
||||
nvf.homeManagerModules.default # <- this imports the home-manager module that provides the options
|
||||
./home.nix # <- your home entrypoint, `programs.nvf.*` may be defined here
|
||||
|
|
|
@ -16,26 +16,32 @@ the default theme enabled. You may use other options inside `config.vim` in
|
|||
nvf.url = "github:notashelf/nvf";
|
||||
};
|
||||
|
||||
outputs = {nixpkgs, nvf, ...}: let
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
configModule = {
|
||||
outputs = {
|
||||
nixpkgs,
|
||||
nvf,
|
||||
self,
|
||||
...
|
||||
}: {
|
||||
# This will make the package available as a flake output under 'packages'
|
||||
packages.x86_64-linux.my-neovim =
|
||||
(nvf.lib.neovimConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
modules = [
|
||||
# Or move this to a separate file and add it's path here instead
|
||||
# IE: ./nvf_module.nix
|
||||
(
|
||||
{pkgs, ...}: {
|
||||
# Add any custom options (and do feel free to upstream them!)
|
||||
# options = { ... };
|
||||
|
||||
config.vim = {
|
||||
theme.enable = true;
|
||||
# and more options as you see fit...
|
||||
};
|
||||
};
|
||||
|
||||
customNeovim = nvf.lib.neovimConfiguration {
|
||||
inherit pkgs;
|
||||
modules = [configModule];
|
||||
};
|
||||
in {
|
||||
# This will make the package available as a flake output under 'packages'
|
||||
packages.${system}.my-neovim = customNeovim.neovim;
|
||||
}
|
||||
)
|
||||
];
|
||||
})
|
||||
.neovim;
|
||||
|
||||
# Example nixosConfiguration using the configured Neovim package
|
||||
nixosConfigurations = {
|
||||
|
@ -43,11 +49,13 @@ the default theme enabled. You may use other options inside `config.vim` in
|
|||
# ...
|
||||
modules = [
|
||||
# This will make wrapped neovim available in your system packages
|
||||
{environment.systemPackages = [customNeovim.neovim];}
|
||||
# Can also move this to another config file if you pass inputs/self around with specialArgs
|
||||
({pkgs, ...}: {
|
||||
environment.systemPackages = [self.packages.${pkgs.stdenv.system}.neovim];
|
||||
})
|
||||
];
|
||||
# ...
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
}```
|
||||
|
|
|
@ -47,6 +47,12 @@
|
|||
|
||||
- Add Haskell support under `vim.languages.haskell` using [haskell-tools.nvim].
|
||||
|
||||
[horriblename](https://github.com/horriblename):
|
||||
|
||||
[blink.cmp]: https://github.com/saghen/blink.cmp
|
||||
|
||||
- Add [blink.cmp] support
|
||||
|
||||
[diniamo](https://github.com/diniamo):
|
||||
|
||||
- Add Odin support under `vim.languages.odin`.
|
||||
|
|
2841
flake.lock
generated
2841
flake.lock
generated
File diff suppressed because it is too large
Load diff
874
flake.nix
874
flake.nix
|
@ -7,7 +7,7 @@
|
|||
} @ inputs: let
|
||||
# call the extended library with `inputs`
|
||||
# inputs is used to get the original standard library, and to pass inputs to the plugin autodiscovery function
|
||||
lib = import ./lib/stdlib-extended.nix inputs;
|
||||
lib = import ./lib/stdlib-extended.nix {inherit inputs self;};
|
||||
in
|
||||
flake-parts.lib.mkFlake {
|
||||
inherit inputs;
|
||||
|
@ -53,6 +53,8 @@
|
|||
''
|
||||
self.nixosModules.nvf;
|
||||
};
|
||||
|
||||
inherit (lib.importJSON ./npins/sources.json) pins;
|
||||
};
|
||||
|
||||
perSystem = {pkgs, ...}: {
|
||||
|
@ -97,874 +99,8 @@
|
|||
inputs.flake-utils.follows = "flake-utils";
|
||||
};
|
||||
|
||||
## Plugins
|
||||
# Lazy loading
|
||||
plugin-lz-n = {
|
||||
url = "github:nvim-neorocks/lz.n";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-lzn-auto-require = {
|
||||
url = "github:horriblename/lzn-auto-require/require-rewrite";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-rtp-nvim = {
|
||||
url = "github:nvim-neorocks/rtp.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# LSP plugins
|
||||
plugin-nvim-lspconfig = {
|
||||
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-fastaction-nvim = {
|
||||
url = "github:Chaitanyabsprip/fastaction.nvim";
|
||||
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;
|
||||
};
|
||||
|
||||
plugin-otter-nvim = {
|
||||
url = "github:jmbuhr/otter.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Language support
|
||||
plugin-sqls-nvim = {
|
||||
url = "github:nanotee/sqls.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-rustaceanvim = {
|
||||
url = "github:mrcjkb/rustaceanvim";
|
||||
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-tools = {
|
||||
url = "github:elixir-tools/elixir-tools.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-ts-error-translator = {
|
||||
url = "github:dmmulroy/ts-error-translator.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-typst-preview-nvim = {
|
||||
url = "github:chomosuke/typst-preview.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-nvim-metals = {
|
||||
url = "github:scalameta/nvim-metals";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-omnisharp-extended = {
|
||||
url = "github:Hoffs/omnisharp-extended-lsp.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-csharpls-extended = {
|
||||
url = "github:Decodetalkers/csharpls-extended-lsp.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;
|
||||
};
|
||||
|
||||
# Pickers
|
||||
plugin-telescope = {
|
||||
url = "github:nvim-telescope/telescope.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-fzf-lua = {
|
||||
url = "github:ibhagwan/fzf-lua";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Runners
|
||||
plugin-run-nvim = {
|
||||
url = "github:diniamo/run.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Debuggers
|
||||
plugin-nvim-dap = {
|
||||
url = "github:mfussenegger/nvim-dap";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-nvim-dap-ui = {
|
||||
url = "github:rcarriga/nvim-dap-ui";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-nvim-dap-go = {
|
||||
url = "github:leoluz/nvim-dap-go";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Filetrees
|
||||
plugin-nvim-tree-lua = {
|
||||
url = "github:nvim-tree/nvim-tree.lua";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-neo-tree-nvim = {
|
||||
url = "github:nvim-neo-tree/neo-tree.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Tablines
|
||||
plugin-nvim-bufferline-lua = {
|
||||
url = "github:akinsho/nvim-bufferline.lua";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Statuslines
|
||||
plugin-lualine = {
|
||||
url = "github:hoob3rt/lualine.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-nvim-cmp = {
|
||||
url = "github:hrsh7th/nvim-cmp";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-cmp-buffer = {
|
||||
url = "github:hrsh7th/cmp-buffer";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-cmp-nvim-lsp = {
|
||||
url = "github:hrsh7th/cmp-nvim-lsp";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-cmp-path = {
|
||||
url = "github:hrsh7th/cmp-path";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-cmp-treesitter = {
|
||||
url = "github:ray-x/cmp-treesitter";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-cmp-luasnip = {
|
||||
url = "github:saadparwaiz1/cmp_luasnip";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# snippets
|
||||
plugin-luasnip = {
|
||||
url = "github:L3MON4D3/LuaSnip";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-friendly-snippets = {
|
||||
url = "github:rafamadriz/friendly-snippets";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Presence
|
||||
plugin-neocord = {
|
||||
url = "github:IogaMaster/neocord";
|
||||
flake = false; # uses flake-utils, avoid the flake
|
||||
};
|
||||
|
||||
# Autopairs
|
||||
plugin-nvim-autopairs = {
|
||||
url = "github:windwp/nvim-autopairs";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-nvim-ts-autotag = {
|
||||
url = "github:windwp/nvim-ts-autotag";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Commenting
|
||||
plugin-comment-nvim = {
|
||||
url = "github:numToStr/Comment.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-todo-comments = {
|
||||
url = "github:folke/todo-comments.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Buffer tools
|
||||
plugin-bufdelete-nvim = {
|
||||
url = "github:famiu/bufdelete.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Dashboard Utilities
|
||||
plugin-dashboard-nvim = {
|
||||
url = "github:glepnir/dashboard-nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-alpha-nvim = {
|
||||
url = "github:goolord/alpha-nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-vim-startify = {
|
||||
url = "github:mhinz/vim-startify";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Themes
|
||||
plugin-base16 = {
|
||||
url = "github:rrethy/base16-nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-tokyonight = {
|
||||
url = "github:folke/tokyonight.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-onedark = {
|
||||
url = "github:navarasu/onedark.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-catppuccin = {
|
||||
url = "github:catppuccin/nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-dracula = {
|
||||
url = "github:Mofiqul/dracula.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-oxocarbon = {
|
||||
url = "github:nyoom-engineering/oxocarbon.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-gruvbox = {
|
||||
url = "github:ellisonleao/gruvbox.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-rose-pine = {
|
||||
url = "github:rose-pine/neovim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-nord = {
|
||||
url = "github:gbprod/nord.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Rust crates
|
||||
plugin-crates-nvim = {
|
||||
url = "github:Saecki/crates.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Project Management
|
||||
plugin-project-nvim = {
|
||||
url = "github:ahmedkhalf/project.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Visuals
|
||||
plugin-nvim-cursorline = {
|
||||
url = "github:yamatsum/nvim-cursorline";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-nvim-scrollbar = {
|
||||
url = "github:petertriho/nvim-scrollbar";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-cinnamon-nvim = {
|
||||
url = "github:declancm/cinnamon.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-cellular-automaton = {
|
||||
url = "github:Eandrju/cellular-automaton.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-indent-blankline = {
|
||||
url = "github:lukas-reineke/indent-blankline.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-nvim-web-devicons = {
|
||||
url = "github:nvim-tree/nvim-web-devicons";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-tiny-devicons-auto-colors = {
|
||||
url = "github:rachartier/tiny-devicons-auto-colors.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-gitsigns-nvim = {
|
||||
url = "github:lewis6991/gitsigns.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-vim-fugitive = {
|
||||
url = "github:tpope/vim-fugitive";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-fidget-nvim = {
|
||||
url = "github:j-hui/fidget.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-highlight-undo = {
|
||||
url = "github:tzachar/highlight-undo.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-render-markdown-nvim = {
|
||||
url = "github:MeanderingProgrammer/render-markdown.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-rainbow-delimiters = {
|
||||
url = "github:HiPhish/rainbow-delimiters.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Minimap
|
||||
plugin-minimap-vim = {
|
||||
url = "github:wfxr/minimap.vim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-codewindow-nvim = {
|
||||
url = "github:gorbit99/codewindow.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Notifications
|
||||
plugin-nvim-notify = {
|
||||
url = "github:rcarriga/nvim-notify";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Utilities
|
||||
plugin-ccc = {
|
||||
url = "github:uga-rosa/ccc.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-diffview-nvim = {
|
||||
url = "github:sindrets/diffview.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-icon-picker-nvim = {
|
||||
url = "github:ziontee113/icon-picker.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-which-key = {
|
||||
url = "github:folke/which-key.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-cheatsheet-nvim = {
|
||||
url = "github:sudormrfbin/cheatsheet.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-gesture-nvim = {
|
||||
url = "github:notomo/gesture.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-hop-nvim = {
|
||||
url = "github:phaazon/hop.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-leap-nvim = {
|
||||
url = "github:ggandor/leap.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-smartcolumn = {
|
||||
url = "github:m4xshen/smartcolumn.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-nvim-surround = {
|
||||
url = "github:kylechui/nvim-surround";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-glow-nvim = {
|
||||
url = "github:ellisonleao/glow.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-image-nvim = {
|
||||
url = "github:3rd/image.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-precognition-nvim = {
|
||||
url = "github:tris203/precognition.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-yanky-nvim = {
|
||||
url = "github:gbprod/yanky.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Note-taking
|
||||
plugin-obsidian-nvim = {
|
||||
url = "github:epwalsh/obsidian.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-orgmode-nvim = {
|
||||
url = "github:nvim-orgmode/orgmode";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mind-nvim = {
|
||||
url = "github:phaazon/mind.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Spellchecking
|
||||
plugin-vim-dirtytalk = {
|
||||
url = "github:psliwka/vim-dirtytalk";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Terminal
|
||||
plugin-toggleterm-nvim = {
|
||||
url = "github:akinsho/toggleterm.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# UI
|
||||
plugin-nvim-navbuddy = {
|
||||
url = "github:SmiteshP/nvim-navbuddy";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-nvim-navic = {
|
||||
url = "github:SmiteshP/nvim-navic";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-noice-nvim = {
|
||||
url = "github:folke/noice.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-modes-nvim = {
|
||||
url = "github:mvllow/modes.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-nvim-colorizer-lua = {
|
||||
url = "github:catgoose/nvim-colorizer.lua";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-vim-illuminate = {
|
||||
url = "github:RRethy/vim-illuminate";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Assistant
|
||||
plugin-chatgpt = {
|
||||
url = "github:jackMort/ChatGPT.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-copilot-lua = {
|
||||
url = "github:zbirenbaum/copilot.lua";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-copilot-cmp = {
|
||||
url = "github:zbirenbaum/copilot-cmp";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Session management
|
||||
plugin-nvim-session-manager = {
|
||||
url = "github:Shatur/neovim-session-manager";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Dependencies
|
||||
plugin-plenary-nvim = {
|
||||
# (required by crates-nvim)
|
||||
url = "github:nvim-lua/plenary.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-dressing-nvim = {
|
||||
# (required by icon-picker-nvim)
|
||||
url = "github:stevearc/dressing.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-vim-markdown = {
|
||||
# (required by obsidian-nvim)
|
||||
url = "github:preservim/vim-markdown";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-tabular = {
|
||||
# (required by vim-markdown)
|
||||
url = "github:godlygeek/tabular";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-lua-utils-nvim = {
|
||||
url = "github:nvim-neorg/lua-utils.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-pathlib-nvim = {
|
||||
url = "github:pysan3/pathlib.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-neorg = {
|
||||
url = "github:nvim-neorg/neorg";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-neorg-telescope = {
|
||||
url = "github:nvim-neorg/neorg-telescope";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-nui-nvim = {
|
||||
# (required by noice.nvim)
|
||||
url = "github:MunifTanjim/nui.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-vim-repeat = {
|
||||
# (required by leap.nvim)
|
||||
url = "github:tpope/vim-repeat";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-nvim-nio = {
|
||||
# (required by nvim-dap-ui)
|
||||
url = "github:nvim-neotest/nvim-nio";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-promise-async = {
|
||||
url = "github:kevinhwang91/promise-async";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-nvim-ufo = {
|
||||
url = "github:kevinhwang91/nvim-ufo";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-new-file-template-nvim = {
|
||||
# (required by new-file-template.nvim)
|
||||
url = "github:otavioschwanck/new-file-template.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-haskell-tools-nvim = {
|
||||
url = "github:mrcjkb/haskell-tools.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-aerial-nvim = {
|
||||
url = "github:stevearc/aerial.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Mini.nvim
|
||||
plugin-mini-ai = {
|
||||
url = "github:echasnovski/mini.ai";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-align = {
|
||||
url = "github:echasnovski/mini.align";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-animate = {
|
||||
url = "github:echasnovski/mini.animate";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-base16 = {
|
||||
url = "github:echasnovski/mini.base16";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-basics = {
|
||||
url = "github:echasnovski/mini.basics";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-bracketed = {
|
||||
url = "github:echasnovski/mini.bracketed";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-bufremove = {
|
||||
url = "github:echasnovski/mini.bufremove";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-clue = {
|
||||
url = "github:echasnovski/mini.clue";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-colors = {
|
||||
url = "github:echasnovski/mini.colors";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-comment = {
|
||||
url = "github:echasnovski/mini.comment";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-completion = {
|
||||
url = "github:echasnovski/mini.completion";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-diff = {
|
||||
url = "github:echasnovski/mini.diff";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-doc = {
|
||||
url = "github:echasnovski/mini.doc";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-extra = {
|
||||
url = "github:echasnovski/mini.extra";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-files = {
|
||||
url = "github:echasnovski/mini.files";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-fuzzy = {
|
||||
url = "github:echasnovski/mini.fuzzy";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-git = {
|
||||
url = "github:echasnovski/mini-git";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-hipatterns = {
|
||||
url = "github:echasnovski/mini.hipatterns";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-hues = {
|
||||
url = "github:echasnovski/mini.hues";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-icons = {
|
||||
url = "github:echasnovski/mini.icons";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-indentscope = {
|
||||
url = "github:echasnovski/mini.indentscope";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-jump = {
|
||||
url = "github:echasnovski/mini.jump";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-jump2d = {
|
||||
url = "github:echasnovski/mini.jump2d";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-map = {
|
||||
url = "github:echasnovski/mini.map";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-misc = {
|
||||
url = "github:echasnovski/mini.misc";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-move = {
|
||||
url = "github:echasnovski/mini.move";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-notify = {
|
||||
url = "github:echasnovski/mini.notify";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-operators = {
|
||||
url = "github:echasnovski/mini.operators";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-pairs = {
|
||||
url = "github:echasnovski/mini.pairs";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-pick = {
|
||||
url = "github:echasnovski/mini.pick";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-sessions = {
|
||||
url = "github:echasnovski/mini.sessions";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-snippets = {
|
||||
url = "github:echasnovski/mini.snippets";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-splitjoin = {
|
||||
url = "github:echasnovski/mini.splitjoin";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-starter = {
|
||||
url = "github:echasnovski/mini.starter";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-statusline = {
|
||||
url = "github:echasnovski/mini.statusline";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-surround = {
|
||||
url = "github:echasnovski/mini.surround";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-tabline = {
|
||||
url = "github:echasnovski/mini.tabline";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-test = {
|
||||
url = "github:echasnovski/mini.test";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-trailspace = {
|
||||
url = "github:echasnovski/mini.trailspace";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
plugin-mini-visits = {
|
||||
url = "github:echasnovski/mini.visits";
|
||||
blink-cmp = {
|
||||
url = "github:saghen/blink.cmp";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
default = self'.devShells.lsp;
|
||||
nvim-nix = pkgs.mkShellNoCC {packages = [config.packages.nix];};
|
||||
lsp = pkgs.mkShellNoCC {
|
||||
packages = with pkgs; [nil statix deadnix alejandra];
|
||||
packages = with pkgs; [nil statix deadnix alejandra npins];
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -9,10 +9,14 @@
|
|||
overlays = [
|
||||
inputs.self.overlays.default
|
||||
|
||||
(_: _: {
|
||||
(final: _: {
|
||||
# Build nil from source to get most recent
|
||||
# features as they are added.
|
||||
nil = inputs'.nil.packages.default;
|
||||
blink-cmp = final.callPackage ./legacyPackages/blink-cmp.nix {
|
||||
src = inputs.blink-cmp;
|
||||
version = inputs.blink-cmp.shortRev or inputs.blink-cmp.shortDirtyRev or "dirty";
|
||||
};
|
||||
})
|
||||
];
|
||||
};
|
||||
|
|
38
flake/legacyPackages/blink-cmp.nix
Normal file
38
flake/legacyPackages/blink-cmp.nix
Normal file
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
rustPlatform,
|
||||
hostPlatform,
|
||||
vimUtils,
|
||||
git,
|
||||
src,
|
||||
version,
|
||||
}: let
|
||||
blink-fuzzy-lib = rustPlatform.buildRustPackage {
|
||||
pname = "blink-fuzzy-lib";
|
||||
inherit version src;
|
||||
|
||||
env = {
|
||||
# TODO: remove this if plugin stops using nightly rust
|
||||
RUSTC_BOOTSTRAP = true;
|
||||
};
|
||||
nativeBuildInputs = [git];
|
||||
cargoLock = {
|
||||
lockFile = "${src}/Cargo.lock";
|
||||
allowBuiltinFetchGit = true;
|
||||
};
|
||||
};
|
||||
libExt =
|
||||
if hostPlatform.isDarwin
|
||||
then "dylib"
|
||||
else "so";
|
||||
in
|
||||
vimUtils.buildVimPlugin {
|
||||
pname = "blink-cmp";
|
||||
inherit version src;
|
||||
|
||||
# blink references a repro.lua which is placed outside the lua/ directory
|
||||
doCheck = false;
|
||||
preInstall = ''
|
||||
mkdir -p target/release
|
||||
ln -s ${blink-fuzzy-lib}/lib/libblink_cmp_fuzzy.${libExt} target/release/libblink_cmp_fuzzy.${libExt}
|
||||
'';
|
||||
}
|
|
@ -10,10 +10,10 @@
|
|||
nixConfig = import ../configuration.nix false;
|
||||
maximalConfig = import ../configuration.nix true;
|
||||
in {
|
||||
flake.overlays.default = _final: prev: {
|
||||
flake.overlays.default = final: _prev: {
|
||||
inherit neovimConfiguration;
|
||||
neovim-nix = buildPkg prev [nixConfig];
|
||||
neovim-maximal = buildPkg prev [maximalConfig];
|
||||
neovim-nix = buildPkg final [nixConfig];
|
||||
neovim-maximal = buildPkg final [maximalConfig];
|
||||
devPkg = buildPkg pkgs [nixConfig {config.vim.languages.html.enable = pkgs.lib.mkForce true;}];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
self,
|
||||
inputs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
types = import ./types {inherit inputs lib;};
|
||||
|
||||
types = import ./types {inherit lib;};
|
||||
config = import ./config.nix {inherit lib;};
|
||||
binds = import ./binds.nix {inherit lib;};
|
||||
dag = import ./dag.nix {inherit lib;};
|
||||
|
@ -12,5 +12,5 @@
|
|||
lists = import ./lists.nix {inherit lib;};
|
||||
attrsets = import ./attrsets.nix {inherit lib;};
|
||||
lua = import ./lua.nix {inherit lib;};
|
||||
neovimConfiguration = import ../modules {inherit inputs lib;};
|
||||
neovimConfiguration = import ../modules {inherit self inputs lib;};
|
||||
}
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
# Convenience function that returns the given Nixpkgs standard library
|
||||
# extended with our functions using `lib.extend`.
|
||||
inputs:
|
||||
{
|
||||
inputs,
|
||||
self,
|
||||
...
|
||||
} @ args:
|
||||
inputs.nixpkgs.lib.extend (self: super: {
|
||||
# WARNING: New functions should not be added here, but to files
|
||||
# imported by `./default.nix` under their own categories. If your
|
||||
|
@ -12,7 +16,7 @@ inputs.nixpkgs.lib.extend (self: super: {
|
|||
# E.g. for an input called `nvf`, `inputs.nvf.lib.nvim` will return the set
|
||||
# below.
|
||||
nvim = import ./. {
|
||||
inherit inputs;
|
||||
inherit (args) inputs self;
|
||||
lib = self;
|
||||
};
|
||||
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
{
|
||||
inputs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
{lib}: let
|
||||
typesDag = import ./dag.nix {inherit lib;};
|
||||
typesPlugin = import ./plugins.nix {inherit inputs lib;};
|
||||
typesPlugin = import ./plugins.nix {inherit lib;};
|
||||
typesLanguage = import ./languages.nix {inherit lib;};
|
||||
customTypes = import ./custom.nix {inherit lib;};
|
||||
in {
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
{
|
||||
inputs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
{lib}: let
|
||||
inherit (lib.options) mkOption;
|
||||
inherit (lib.attrsets) attrNames mapAttrs' filterAttrs nameValuePair;
|
||||
inherit (lib.strings) hasPrefix removePrefix;
|
||||
inherit (lib.types) submodule either package enum str lines attrsOf anything listOf nullOr;
|
||||
inherit (lib.types) submodule either package enum str lines anything listOf nullOr;
|
||||
|
||||
# Get the names of all flake inputs that start with the given prefix.
|
||||
fromInputs = {
|
||||
|
@ -15,11 +11,8 @@
|
|||
}:
|
||||
mapAttrs' (n: v: nameValuePair (removePrefix prefix n) {src = v;}) (filterAttrs (n: _: hasPrefix prefix n) inputs);
|
||||
|
||||
# Get the names of all flake inputs that start with the given prefix.
|
||||
pluginInputNames = attrNames (fromInputs {
|
||||
inherit inputs;
|
||||
prefix = "plugin-";
|
||||
});
|
||||
# Get the names of all npins
|
||||
pluginInputNames = attrNames (lib.importJSON ../../npins/sources.json).pins;
|
||||
|
||||
# You can either use the name of the plugin or a package.
|
||||
pluginType = nullOr (
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
self,
|
||||
inputs,
|
||||
lib,
|
||||
}: {
|
||||
|
@ -23,7 +24,7 @@
|
|||
specialArgs =
|
||||
extraSpecialArgs
|
||||
// {
|
||||
inherit inputs;
|
||||
inherit self inputs;
|
||||
modulesPath = toString ./.;
|
||||
};
|
||||
modules = concatLists [
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
inherit (lib.nvim.config) batchRenameOptions;
|
||||
|
||||
renamedVimOpts = batchRenameOptions ["vim"] ["vim" "options"] {
|
||||
# 2024-12-01
|
||||
colourTerm = "termguicolors";
|
||||
mouseSupport = "mouse";
|
||||
cmdHeight = "cmdheight";
|
||||
|
@ -15,6 +16,9 @@
|
|||
autoIndent = "autoindent";
|
||||
wordWrap = "wrap";
|
||||
showSignColumn = "signcolumn";
|
||||
|
||||
# 2025-02-07
|
||||
scrollOff = "scrolloff";
|
||||
};
|
||||
in {
|
||||
imports = concatLists [
|
||||
|
@ -93,9 +97,15 @@ in {
|
|||
|
||||
# 2024-12-02
|
||||
(mkRenamedOptionModule ["vim" "enableEditorconfig"] ["vim" "globals" "editorconfig"])
|
||||
|
||||
# 2025-02-06
|
||||
(mkRemovedOptionModule ["vim" "disableArrows"] ''
|
||||
Top-level convenience options are now in the process of being removed from nvf as
|
||||
their behaviour was abstract, and confusing. Please use 'vim.options' or 'vim.luaConfigRC'
|
||||
to replicate previous behaviour.
|
||||
'')
|
||||
]
|
||||
|
||||
# 2024-12-01
|
||||
# Migrated via batchRenameOptions. Further batch renames must be below this line.
|
||||
renamedVimOpts
|
||||
];
|
||||
|
|
|
@ -23,7 +23,9 @@
|
|||
"completion"
|
||||
"dashboard"
|
||||
"debugger"
|
||||
"diagnostics"
|
||||
"filetree"
|
||||
"formatter"
|
||||
"git"
|
||||
"languages"
|
||||
"lsp"
|
||||
|
|
|
@ -16,12 +16,6 @@
|
|||
cfg = config.vim;
|
||||
in {
|
||||
options.vim = {
|
||||
disableArrows = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
description = "Set to prevent arrow keys from moving cursor";
|
||||
};
|
||||
|
||||
hideSearchHighlight = mkOption {
|
||||
type = bool;
|
||||
default = false;
|
||||
|
|
|
@ -26,34 +26,6 @@
|
|||
in {
|
||||
config = {
|
||||
vim.keymaps = mkMerge [
|
||||
(
|
||||
mkIf cfg.disableArrows [
|
||||
{
|
||||
key = "<up>";
|
||||
mode = ["n" "i"];
|
||||
action = "<nop>";
|
||||
noremap = false;
|
||||
}
|
||||
{
|
||||
key = "<down>";
|
||||
mode = ["n" "i"];
|
||||
action = "<nop>";
|
||||
noremap = false;
|
||||
}
|
||||
{
|
||||
key = "<left>";
|
||||
mode = ["n" "i"];
|
||||
action = "<nop>";
|
||||
noremap = false;
|
||||
}
|
||||
{
|
||||
key = "<right>";
|
||||
mode = ["n" "i"];
|
||||
action = "<nop>";
|
||||
noremap = false;
|
||||
}
|
||||
]
|
||||
)
|
||||
(
|
||||
pipe cfg.maps
|
||||
[
|
||||
|
|
120
modules/plugins/completion/blink-cmp/blink-cmp.nix
Normal file
120
modules/plugins/completion/blink-cmp/blink-cmp.nix
Normal file
|
@ -0,0 +1,120 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption mkOption literalMD;
|
||||
inherit (lib.types) listOf str either attrsOf submodule enum anything int nullOr;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption luaInline;
|
||||
inherit (lib.nvim.binds) mkMappingOption;
|
||||
inherit (lib.nvim.config) mkBool;
|
||||
|
||||
keymapType = submodule {
|
||||
freeformType = attrsOf (listOf (either str luaInline));
|
||||
options = {
|
||||
preset = mkOption {
|
||||
type = enum ["default" "none" "super-tab" "enter"];
|
||||
default = "none";
|
||||
description = "keymap presets";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
providerType = submodule {
|
||||
freeformType = anything;
|
||||
options = {
|
||||
module = mkOption {
|
||||
type = str;
|
||||
description = "module of the provider";
|
||||
};
|
||||
};
|
||||
};
|
||||
in {
|
||||
options.vim.autocomplete.blink-cmp = {
|
||||
enable = mkEnableOption "blink.cmp";
|
||||
setupOpts = mkPluginSetupOption "blink.cmp" {
|
||||
sources = {
|
||||
default = mkOption {
|
||||
type = listOf str;
|
||||
default = ["lsp" "path" "snippets" "buffer"];
|
||||
description = "Default list of sources to enable for completion.";
|
||||
};
|
||||
|
||||
cmdline = mkOption {
|
||||
type = nullOr (listOf str);
|
||||
default = [];
|
||||
description = "List of sources to enable for cmdline. Null means use default source list.";
|
||||
};
|
||||
|
||||
providers = mkOption {
|
||||
type = attrsOf providerType;
|
||||
default = {};
|
||||
description = "Settings for completion providers";
|
||||
};
|
||||
|
||||
transform_items = mkOption {
|
||||
type = nullOr luaInline;
|
||||
default = mkLuaInline "function(_, items) return items end";
|
||||
defaultText = ''
|
||||
Our default does nothing. If you want blink.cmp's default, which
|
||||
lowers the score for snippets, set this option to null.
|
||||
'';
|
||||
description = ''
|
||||
Function to use when transforming the items before they're returned
|
||||
for all providers.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
completion = {
|
||||
documentation = {
|
||||
auto_show = mkBool true "Show documentation whenever an item is selected";
|
||||
auto_show_delay_ms = mkOption {
|
||||
type = int;
|
||||
default = 200;
|
||||
description = "Delay before auto show triggers";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
keymap = mkOption {
|
||||
type = keymapType;
|
||||
default = {};
|
||||
description = "blink.cmp keymap";
|
||||
example = literalMD ''
|
||||
```nix
|
||||
vim.autocomplete.blink-cmp.setupOpts.keymap = {
|
||||
preset = "none";
|
||||
|
||||
"<Up>" = ["select_prev" "fallback"];
|
||||
"<C-n>" = [
|
||||
(lib.generators.mkLuaInline ''''
|
||||
function(cmp)
|
||||
if some_condition then return end -- runs the next command
|
||||
return true -- doesn't run the next command
|
||||
end,
|
||||
'''')
|
||||
"select_next"
|
||||
];
|
||||
};
|
||||
```
|
||||
'';
|
||||
};
|
||||
|
||||
fuzzy = {
|
||||
prebuilt_binaries = {
|
||||
download = mkBool false ''
|
||||
Auto-downloads prebuilt binaries. Do not enable, it doesn't work on nix
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
mappings = {
|
||||
complete = mkMappingOption "Complete [blink.cmp]" "<C-Space>";
|
||||
confirm = mkMappingOption "Confirm [blink.cmp]" "<CR>";
|
||||
next = mkMappingOption "Next item [blink.cmp]" "<Tab>";
|
||||
previous = mkMappingOption "Previous item [blink.cmp]" "<S-Tab>";
|
||||
close = mkMappingOption "Close [blink.cmp]" "<C-e>";
|
||||
scrollDocsUp = mkMappingOption "Scroll docs up [blink.cmp]" "<C-d>";
|
||||
scrollDocsDown = mkMappingOption "Scroll docs down [blink.cmp]" "<C-f>";
|
||||
};
|
||||
};
|
||||
}
|
91
modules/plugins/completion/blink-cmp/config.nix
Normal file
91
modules/plugins/completion/blink-cmp/config.nix
Normal file
|
@ -0,0 +1,91 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.strings) optionalString;
|
||||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (builtins) concatStringsSep typeOf tryEval attrNames mapAttrs;
|
||||
|
||||
cfg = config.vim.autocomplete.blink-cmp;
|
||||
cmpCfg = config.vim.autocomplete.nvim-cmp;
|
||||
inherit (cfg) mappings;
|
||||
|
||||
getPluginName = plugin:
|
||||
if typeOf plugin == "string"
|
||||
then plugin
|
||||
else if (plugin ? pname && (tryEval plugin.pname).success)
|
||||
then plugin.pname
|
||||
else plugin.name;
|
||||
in {
|
||||
vim = mkIf cfg.enable {
|
||||
startPlugins = ["blink-compat"];
|
||||
lazy.plugins = {
|
||||
blink-cmp = {
|
||||
package = "blink-cmp";
|
||||
setupModule = "blink.cmp";
|
||||
inherit (cfg) setupOpts;
|
||||
|
||||
# TODO: lazy disabled until lspconfig is lazy loaded
|
||||
#
|
||||
# event = ["InsertEnter" "CmdlineEnter"];
|
||||
|
||||
after = ''
|
||||
${optionalString config.vim.lazy.enable
|
||||
(concatStringsSep "\n" (map
|
||||
(package: "require('lz.n').trigger_load(${toLuaObject (getPluginName package)})")
|
||||
cmpCfg.sourcePlugins))}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
autocomplete = {
|
||||
enableSharedCmpSources = true;
|
||||
blink-cmp.setupOpts = {
|
||||
sources = {
|
||||
default = ["lsp" "path" "snippets" "buffer"] ++ (attrNames cmpCfg.sources);
|
||||
providers =
|
||||
mapAttrs (name: _: {
|
||||
inherit name;
|
||||
module = "blink.compat.source";
|
||||
})
|
||||
cmpCfg.sources;
|
||||
};
|
||||
snippets = mkIf config.vim.snippets.luasnip.enable {
|
||||
preset = "luasnip";
|
||||
};
|
||||
|
||||
keymap = {
|
||||
${mappings.complete} = ["show" "fallback"];
|
||||
${mappings.close} = ["hide" "fallback"];
|
||||
${mappings.scrollDocsUp} = ["scroll_documentation_up" "fallback"];
|
||||
${mappings.scrollDocsDown} = ["scroll_documentation_down" "fallback"];
|
||||
${mappings.confirm} = ["accept" "fallback"];
|
||||
|
||||
${mappings.next} = [
|
||||
"select_next"
|
||||
"snippet_forward"
|
||||
(mkLuaInline ''
|
||||
function(cmp)
|
||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
has_words_before = col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||
|
||||
if has_words_before then
|
||||
return cmp.show()
|
||||
end
|
||||
end
|
||||
'')
|
||||
"fallback"
|
||||
];
|
||||
${mappings.previous} = [
|
||||
"select_prev"
|
||||
"snippet_backward"
|
||||
"fallback"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
6
modules/plugins/completion/blink-cmp/default.nix
Normal file
6
modules/plugins/completion/blink-cmp/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./blink-cmp.nix
|
||||
./config.nix
|
||||
];
|
||||
}
|
34
modules/plugins/completion/config.nix
Normal file
34
modules/plugins/completion/config.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.attrsets) mapListToAttrs;
|
||||
inherit (builtins) typeOf tryEval;
|
||||
|
||||
cfg = config.vim.autocomplete;
|
||||
getPluginName = plugin:
|
||||
if typeOf plugin == "string"
|
||||
then plugin
|
||||
else if (plugin ? pname && (tryEval plugin.pname).success)
|
||||
then plugin.pname
|
||||
else plugin.name;
|
||||
in {
|
||||
config.vim = mkIf cfg.enableSharedCmpSources {
|
||||
startPlugins = ["rtp-nvim"];
|
||||
lazy.plugins =
|
||||
mapListToAttrs (package: {
|
||||
name = getPluginName package;
|
||||
value = {
|
||||
inherit package;
|
||||
lazy = true;
|
||||
after = ''
|
||||
local path = vim.fn.globpath(vim.o.packpath, 'pack/*/opt/${getPluginName package}')
|
||||
require("rtp_nvim").source_after_plugin_dir(path)
|
||||
'';
|
||||
};
|
||||
})
|
||||
cfg.nvim-cmp.sourcePlugins;
|
||||
};
|
||||
}
|
|
@ -1,5 +1,9 @@
|
|||
{
|
||||
imports = [
|
||||
./module.nix
|
||||
./config.nix
|
||||
|
||||
./nvim-cmp
|
||||
./blink-cmp
|
||||
];
|
||||
}
|
||||
|
|
7
modules/plugins/completion/module.nix
Normal file
7
modules/plugins/completion/module.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkEnableOption;
|
||||
in {
|
||||
options.vim.autocomplete = {
|
||||
enableSharedCmpSources = mkEnableOption "sources shared by blink.cmp and nvim-cmp";
|
||||
};
|
||||
}
|
|
@ -24,21 +24,7 @@
|
|||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["rtp-nvim"];
|
||||
lazy.plugins = mkMerge [
|
||||
(mapListToAttrs (package: {
|
||||
name = getPluginName package;
|
||||
value = {
|
||||
inherit package;
|
||||
lazy = true;
|
||||
after = ''
|
||||
local path = vim.fn.globpath(vim.o.packpath, 'pack/*/opt/${getPluginName package}')
|
||||
require("rtp_nvim").source_after_plugin_dir(path)
|
||||
'';
|
||||
};
|
||||
})
|
||||
cfg.sourcePlugins)
|
||||
{
|
||||
lazy.plugins = {
|
||||
nvim-cmp = {
|
||||
package = "nvim-cmp";
|
||||
after = ''
|
||||
|
@ -68,10 +54,12 @@ in {
|
|||
|
||||
event = ["InsertEnter" "CmdlineEnter"];
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
autocomplete.nvim-cmp = {
|
||||
autocomplete = {
|
||||
enableSharedCmpSources = true;
|
||||
|
||||
nvim-cmp = {
|
||||
sources = {
|
||||
nvim-cmp = null;
|
||||
buffer = "[Buffer]";
|
||||
|
@ -137,4 +125,5 @@ in {
|
|||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
3
modules/plugins/diagnostics/default.nix
Normal file
3
modules/plugins/diagnostics/default.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
imports = [./nvim-lint];
|
||||
}
|
20
modules/plugins/diagnostics/nvim-lint/config.nix
Normal file
20
modules/plugins/diagnostics/nvim-lint/config.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
|
||||
cfg = config.vim.diagnostics.nvim-lint;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["nvim-lint"];
|
||||
pluginRC.nvim-lint = entryAnywhere ''
|
||||
require("lint").setup(${toLuaObject cfg.setupOpts})
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
6
modules/plugins/diagnostics/nvim-lint/default.nix
Normal file
6
modules/plugins/diagnostics/nvim-lint/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./nvim-lint.nix
|
||||
./config.nix
|
||||
];
|
||||
}
|
27
modules/plugins/diagnostics/nvim-lint/nvim-lint.nix
Normal file
27
modules/plugins/diagnostics/nvim-lint/nvim-lint.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{lib, ...}: let
|
||||
inherit (lib.options) mkOption mkEnableOption;
|
||||
inherit (lib.types) attrsOf listOf str;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
in {
|
||||
options.vim.diagnostics.nvim-lint = {
|
||||
enable = mkEnableOption "asynchronous linter plugin for Neovim [nvim-lint]";
|
||||
setupOpts = mkPluginSetupOption "nvim-lint" {
|
||||
linters_by_ft = mkOption {
|
||||
type = attrsOf (listOf str);
|
||||
default = {};
|
||||
example = {
|
||||
text = ["vale"];
|
||||
markdown = ["vale"];
|
||||
};
|
||||
|
||||
description = ''
|
||||
Map of filetype to formatters. This option takes a set of
|
||||
`key = value` format where the `value` will be converted
|
||||
to its Lua equivalent. You are responsible for passing the
|
||||
correct Nix data types to generate a correct Lua value that
|
||||
conform is able to accept.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
20
modules/plugins/formatter/conform-nvim/config.nix
Normal file
20
modules/plugins/formatter/conform-nvim/config.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf;
|
||||
inherit (lib.nvim.dag) entryAnywhere;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
|
||||
cfg = config.vim.formatter.conform-nvim;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["conform-nvim"];
|
||||
pluginRC.conform-nvim = entryAnywhere ''
|
||||
require("conform").setup(${toLuaObject cfg.setupOpts})
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
56
modules/plugins/formatter/conform-nvim/conform-nvim.nix
Normal file
56
modules/plugins/formatter/conform-nvim/conform-nvim.nix
Normal file
|
@ -0,0 +1,56 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
||||
inherit (lib.types) attrs enum;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
inherit (lib.nvim.lua) mkLuaInline;
|
||||
in {
|
||||
options.vim.formatter.conform-nvim = {
|
||||
enable = mkEnableOption "lightweight yet powerful formatter plugin for Neovim [conform-nvim]";
|
||||
setupOpts = mkPluginSetupOption "conform.nvim" {
|
||||
formatters_by_ft = mkOption {
|
||||
type = attrs;
|
||||
default = {};
|
||||
example = {lua = ["stylua"];};
|
||||
description = ''
|
||||
Map of filetype to formatters. This option takes a set of
|
||||
`key = value` format where the `value will` be converted
|
||||
to its Lua equivalent. You are responsible for passing the
|
||||
correct Nix data types to generate a correct Lua value that
|
||||
conform is able to accept.
|
||||
'';
|
||||
};
|
||||
|
||||
default_format_opts = mkOption {
|
||||
type = attrs;
|
||||
default = {lsp_format = "fallback";};
|
||||
description = "Default values when calling `conform.format()`";
|
||||
};
|
||||
|
||||
format_on_save = mkOption {
|
||||
type = attrs;
|
||||
default = {
|
||||
lsp_format = "fallback";
|
||||
timeout_ms = 500;
|
||||
};
|
||||
description = ''
|
||||
Table that will be passed to `conform.format()`. If this
|
||||
is set, Conform will run the formatter on save.
|
||||
'';
|
||||
};
|
||||
|
||||
format_after_save = mkOption {
|
||||
type = attrs;
|
||||
default = {lsp_format = "fallback";};
|
||||
description = ''
|
||||
Table that will be passed to `conform.format()`. If this
|
||||
is set, Conform will run the formatter asynchronously after
|
||||
save.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
6
modules/plugins/formatter/conform-nvim/default.nix
Normal file
6
modules/plugins/formatter/conform-nvim/default.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [
|
||||
./conform-nvim.nix
|
||||
./config.nix
|
||||
];
|
||||
}
|
3
modules/plugins/formatter/default.nix
Normal file
3
modules/plugins/formatter/default.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
imports = [./conform-nvim];
|
||||
}
|
|
@ -8,7 +8,6 @@
|
|||
inherit (lib.modules) mkIf mkMerge;
|
||||
inherit (lib.meta) getExe;
|
||||
inherit (lib.lists) isList;
|
||||
inherit (lib.strings) optionalString;
|
||||
inherit (lib.types) either listOf package str;
|
||||
inherit (lib.nvim.types) mkGrammarOption;
|
||||
inherit (lib.nvim.lua) expToLua;
|
||||
|
@ -16,6 +15,12 @@
|
|||
|
||||
cfg = config.vim.languages.lua;
|
||||
in {
|
||||
imports = [
|
||||
(lib.mkRemovedOptionModule ["vim" "languages" "lua" "lsp" "neodev"] ''
|
||||
neodev has been replaced by lazydev
|
||||
'')
|
||||
];
|
||||
|
||||
options.vim.languages.lua = {
|
||||
enable = mkEnableOption "Lua language support";
|
||||
treesitter = {
|
||||
|
@ -32,7 +37,7 @@ in {
|
|||
default = pkgs.lua-language-server;
|
||||
};
|
||||
|
||||
neodev.enable = mkEnableOption "neodev.nvim integration, useful for neovim plugin developers";
|
||||
lazydev.enable = mkEnableOption "lazydev.nvim integration, useful for neovim plugin developers";
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -49,7 +54,6 @@ in {
|
|||
lspconfig.lua_ls.setup {
|
||||
capabilities = capabilities;
|
||||
on_attach = default_on_attach;
|
||||
${optionalString cfg.lsp.neodev.enable "before_init = require('neodev.lsp').before_init;"}
|
||||
cmd = ${
|
||||
if isList cfg.lsp.package
|
||||
then expToLua cfg.lsp.package
|
||||
|
@ -59,10 +63,15 @@ in {
|
|||
'';
|
||||
})
|
||||
|
||||
(mkIf cfg.lsp.neodev.enable {
|
||||
vim.startPlugins = ["neodev-nvim"];
|
||||
vim.pluginRC.neodev = entryBefore ["lua-lsp"] ''
|
||||
require("neodev").setup({})
|
||||
(mkIf cfg.lsp.lazydev.enable {
|
||||
vim.startPlugins = ["lazydev-nvim"];
|
||||
vim.pluginRC.lazydev = entryBefore ["lua-lsp"] ''
|
||||
require("lazydev").setup({
|
||||
enabled = function(root_dir)
|
||||
return not vim.uv.fs_stat(root_dir .. "/.luarc.json")
|
||||
end,
|
||||
library = { { path = "''${3rd}/luv/library", words = { "vim%.uv" } } },
|
||||
})
|
||||
'';
|
||||
})
|
||||
]))
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
cfg = config.vim.lsp;
|
||||
usingNvimCmp = config.vim.autocomplete.nvim-cmp.enable;
|
||||
usingBlinkCmp = config.vim.autocomplete.blink-cmp.enable;
|
||||
self = import ./module.nix {inherit config lib pkgs;};
|
||||
|
||||
mappingDefinitions = self.options.vim.lsp.mappings;
|
||||
|
@ -22,7 +23,7 @@
|
|||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
autocomplete.nvim-cmp = {
|
||||
autocomplete.nvim-cmp = mkIf usingNvimCmp {
|
||||
sources = {nvim_lsp = "[LSP]";};
|
||||
sourcePlugins = ["cmp-nvim-lsp"];
|
||||
};
|
||||
|
@ -170,6 +171,10 @@ in {
|
|||
},
|
||||
}
|
||||
''}
|
||||
|
||||
${optionalString usingBlinkCmp ''
|
||||
capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||
''}
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
|
|
@ -10,9 +10,19 @@
|
|||
cfg = config.vim.lsp;
|
||||
in {
|
||||
config = mkIf (cfg.enable && cfg.lspSignature.enable) {
|
||||
assertions = [
|
||||
{
|
||||
assertion = !config.vim.autocomplete.blink-cmp.enable;
|
||||
message = ''
|
||||
lsp-signature does not work with blink.cmp. Please use blink.cmp's builtin signature feature:
|
||||
|
||||
vim.autocomplete.blink-cmp.setupOpts.signature.enabled = true;
|
||||
'';
|
||||
}
|
||||
];
|
||||
vim = {
|
||||
startPlugins = [
|
||||
"lsp-signature"
|
||||
"lsp-signature-nvim"
|
||||
];
|
||||
|
||||
lsp.lspSignature.setupOpts = {
|
||||
|
|
|
@ -8,16 +8,18 @@
|
|||
inherit (lib.nvim.lua) toLuaObject;
|
||||
|
||||
cfg = config.vim.lsp.lspkind;
|
||||
usingCmp = config.vim.autocomplete.nvim-cmp.enable;
|
||||
usingBlink = config.vim.autocomplete.blink-cmp.enable;
|
||||
in {
|
||||
config = mkIf cfg.enable {
|
||||
assertions = [
|
||||
{
|
||||
assertion = config.vim.autocomplete.nvim-cmp.enable;
|
||||
assertion = usingCmp || usingBlink;
|
||||
message = ''
|
||||
While lspkind supports Neovim's native lsp upstream, using that over
|
||||
nvim-cmp isn't recommended, nor supported by nvf.
|
||||
nvim-cmp/blink.cmp isn't recommended, nor supported by nvf.
|
||||
|
||||
Please migrate to nvim-cmp if you want to use lspkind.
|
||||
Please migrate to nvim-cmp/blink.cmp if you want to use lspkind.
|
||||
'';
|
||||
}
|
||||
];
|
||||
|
@ -26,9 +28,19 @@ in {
|
|||
startPlugins = ["lspkind"];
|
||||
|
||||
lsp.lspkind.setupOpts.before = config.vim.autocomplete.nvim-cmp.format;
|
||||
autocomplete.nvim-cmp.setupOpts.formatting.format = mkForce (mkLuaInline ''
|
||||
autocomplete = {
|
||||
nvim-cmp = mkIf usingCmp {
|
||||
setupOpts.formatting.format = mkForce (mkLuaInline ''
|
||||
require("lspkind").cmp_format(${toLuaObject cfg.setupOpts})
|
||||
'');
|
||||
};
|
||||
|
||||
blink-cmp = mkIf usingBlink {
|
||||
setupOpts.appearance.kind_icons = mkLuaInline ''
|
||||
require("lspkind").symbol_map
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@ in {
|
|||
{
|
||||
vim = {
|
||||
startPlugins = [
|
||||
"none-ls"
|
||||
"none-ls-nvim"
|
||||
"plenary-nvim"
|
||||
];
|
||||
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
inherit (lib.types) bool str nullOr;
|
||||
inherit (lib.modules) mkRenamedOptionModule;
|
||||
inherit (lib.nvim.types) mkPluginSetupOption;
|
||||
|
||||
autocompleteCfg = config.vim.autocomplete;
|
||||
in {
|
||||
imports = let
|
||||
renamedSetupOption = oldPath: newPath:
|
||||
|
@ -42,7 +44,7 @@ in {
|
|||
# If using nvim-cmp, otherwise set to false
|
||||
type = bool;
|
||||
description = "If using nvim-cmp, otherwise set to false";
|
||||
default = config.vim.autocomplete.nvim-cmp.enable;
|
||||
default = autocompleteCfg.nvim-cmp.enable || autocompleteCfg.blink-cmp.enable;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -15,7 +15,7 @@ in {
|
|||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = [
|
||||
"todo-comments"
|
||||
"todo-comments-nvim"
|
||||
];
|
||||
|
||||
maps.normal = mkMerge [
|
||||
|
|
|
@ -20,7 +20,7 @@ in {
|
|||
after = cfg.loaders;
|
||||
};
|
||||
startPlugins = cfg.providers;
|
||||
autocomplete.nvim-cmp = {
|
||||
autocomplete.nvim-cmp = mkIf config.vim.autocomplete.nvim-cmp.enable {
|
||||
sources = {luasnip = "[LuaSnip]";};
|
||||
sourcePlugins = ["cmp-luasnip"];
|
||||
};
|
||||
|
|
|
@ -34,7 +34,7 @@ in {
|
|||
})
|
||||
(mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["lualine"];
|
||||
startPlugins = ["lualine-nvim"];
|
||||
pluginRC.lualine = entryAnywhere ''
|
||||
local lualine = require('lualine')
|
||||
lualine.setup ${toLuaObject cfg.setupOpts}
|
||||
|
|
|
@ -20,7 +20,8 @@ in {
|
|||
vim = {
|
||||
startPlugins = ["nvim-treesitter"];
|
||||
|
||||
autocomplete.nvim-cmp = {
|
||||
# cmp-treesitter doesn't work on blink.cmp
|
||||
autocomplete.nvim-cmp = mkIf config.vim.autocomplete.nvim-cmp.enable {
|
||||
sources = {treesitter = "[Treesitter]";};
|
||||
sourcePlugins = ["cmp-treesitter"];
|
||||
};
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["smartcolumn"];
|
||||
startPlugins = ["smartcolumn-nvim"];
|
||||
|
||||
pluginRC.smartcolumn = entryAnywhere ''
|
||||
require("smartcolumn").setup(${toLuaObject cfg.setupOpts})
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["which-key"];
|
||||
startPlugins = ["which-key-nvim"];
|
||||
|
||||
pluginRC.whichkey = entryAnywhere ''
|
||||
local wk = require("which-key")
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["highlight-undo"];
|
||||
startPlugins = ["highlight-undo-nvim"];
|
||||
|
||||
pluginRC.highlight-undo = entryAnywhere ''
|
||||
require("highlight-undo").setup(${toLuaObject cfg.setupOpts})
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
in {
|
||||
config = mkIf cfg.enable {
|
||||
vim = {
|
||||
startPlugins = ["indent-blankline"];
|
||||
startPlugins = ["indent-blankline-nvim"];
|
||||
|
||||
pluginRC.indent-blankline = entryAnywhere ''
|
||||
require("ibl").setup(${toLuaObject cfg.setupOpts})
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
cfg = config.vim.visuals.rainbow-delimiters;
|
||||
in {
|
||||
vim = mkIf cfg.enable {
|
||||
startPlugins = ["rainbow-delimiters"];
|
||||
startPlugins = ["rainbow-delimiters-nvim"];
|
||||
|
||||
pluginRC.rainbow-delimiters = entryAnywhere ''
|
||||
vim.g.rainbow_delimiters = ${toLuaObject cfg.setupOpts}
|
||||
|
|
|
@ -1,29 +1,27 @@
|
|||
{
|
||||
inputs,
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}
|
||||
: let
|
||||
}: let
|
||||
inherit (pkgs) vimPlugins;
|
||||
inherit (lib.strings) isString;
|
||||
inherit (lib.lists) filter map;
|
||||
inherit (builtins) path;
|
||||
|
||||
# alias to the internal configuration
|
||||
vimOptions = config.vim;
|
||||
getPin = name: ((pkgs.callPackages ../../../npins/sources.nix {}) // config.vim.pluginOverrides).${name};
|
||||
|
||||
noBuildPlug = pname: let
|
||||
input = inputs."plugin-${pname}";
|
||||
version = input.shortRev or input.shortDirtyRev or "dirty";
|
||||
pin = getPin pname;
|
||||
version = pin.revision or "dirty";
|
||||
in {
|
||||
# vim.lazy.plugins relies on pname, so we only set that here
|
||||
# version isn't needed for anything, but inherit it anyway for correctness
|
||||
inherit pname version;
|
||||
outPath = path {
|
||||
name = "${pname}-0-unstable-${version}";
|
||||
path = input.outPath;
|
||||
path = pin.outPath;
|
||||
};
|
||||
passthru.vimPlugin = false;
|
||||
};
|
||||
|
@ -32,12 +30,12 @@
|
|||
# if the plugin is nvim-treesitter, warn the user to use buildTreesitterPlug
|
||||
# instead
|
||||
buildPlug = attrs: let
|
||||
input = inputs."plugin-${attrs.pname}";
|
||||
pin = getPin attrs.pname;
|
||||
in
|
||||
pkgs.vimUtils.buildVimPlugin (
|
||||
{
|
||||
version = input.shortRev or input.shortDirtyRev or "dirty";
|
||||
src = input.outPath;
|
||||
version = pin.revision or "dirty";
|
||||
src = pin.outPath;
|
||||
}
|
||||
// attrs
|
||||
);
|
||||
|
@ -45,7 +43,7 @@
|
|||
buildTreesitterPlug = grammars: vimPlugins.nvim-treesitter.withPlugins (_: grammars);
|
||||
|
||||
pluginBuilders = {
|
||||
nvim-treesitter = buildTreesitterPlug vimOptions.treesitter.grammars;
|
||||
nvim-treesitter = buildTreesitterPlug config.vim.treesitter.grammars;
|
||||
flutter-tools-patched = buildPlug {
|
||||
pname = "flutter-tools";
|
||||
patches = [./patches/flutter-tools.patch];
|
||||
|
@ -61,42 +59,45 @@
|
|||
"flutter-tools.dev_tools"
|
||||
];
|
||||
};
|
||||
inherit (pkgs) blink-cmp;
|
||||
};
|
||||
|
||||
buildConfigPlugins = plugins:
|
||||
map (
|
||||
plug:
|
||||
map (plug:
|
||||
if (isString plug)
|
||||
then pluginBuilders.${plug} or (noBuildPlug plug)
|
||||
else plug
|
||||
) (filter (f: f != null) plugins);
|
||||
else plug) (
|
||||
filter (f: f != null) plugins
|
||||
);
|
||||
|
||||
# built (or "normalized") plugins that are modified
|
||||
builtStartPlugins = buildConfigPlugins vimOptions.startPlugins;
|
||||
builtOptPlugins = map (package: package // {optional = true;}) (buildConfigPlugins vimOptions.optPlugins);
|
||||
builtStartPlugins = buildConfigPlugins config.vim.startPlugins;
|
||||
builtOptPlugins = map (package: package // {optional = true;}) (
|
||||
buildConfigPlugins config.vim.optPlugins
|
||||
);
|
||||
|
||||
# additional Lua and Python3 packages, mapped to their respective functions
|
||||
# to conform to the format mnw expects. end user should
|
||||
# only ever need to pass a list of packages, which are modified
|
||||
# here
|
||||
extraLuaPackages = ps: map (x: ps.${x}) vimOptions.luaPackages;
|
||||
extraPython3Packages = ps: map (x: ps.${x}) vimOptions.python3Packages;
|
||||
extraLuaPackages = ps: map (x: ps.${x}) config.vim.luaPackages;
|
||||
extraPython3Packages = ps: map (x: ps.${x}) config.vim.python3Packages;
|
||||
|
||||
# Wrap the user's desired (unwrapped) Neovim package with arguments that'll be used to
|
||||
# generate a wrapped Neovim package.
|
||||
neovim-wrapped = inputs.mnw.lib.wrap pkgs {
|
||||
neovim = vimOptions.package;
|
||||
neovim = config.vim.package;
|
||||
plugins = builtStartPlugins ++ builtOptPlugins;
|
||||
appName = "nvf";
|
||||
extraBinPath = vimOptions.extraPackages;
|
||||
initLua = vimOptions.builtLuaConfigRC;
|
||||
luaFiles = vimOptions.extraLuaFiles;
|
||||
extraBinPath = config.vim.extraPackages;
|
||||
initLua = config.vim.builtLuaConfigRC;
|
||||
luaFiles = config.vim.extraLuaFiles;
|
||||
|
||||
inherit (vimOptions) viAlias vimAlias withRuby withNodeJs withPython3;
|
||||
inherit (config.vim) viAlias vimAlias withRuby withNodeJs withPython3;
|
||||
inherit extraLuaPackages extraPython3Packages;
|
||||
};
|
||||
|
||||
dummyInit = pkgs.writeText "nvf-init.lua" vimOptions.builtLuaConfigRC;
|
||||
dummyInit = pkgs.writeText "nvf-init.lua" config.vim.builtLuaConfigRC;
|
||||
# Additional helper scripts for printing and displaying nvf configuration
|
||||
# in your commandline.
|
||||
printConfig = pkgs.writers.writeDashBin "nvf-print-config" "cat ${dummyInit}";
|
||||
|
@ -109,10 +110,10 @@
|
|||
paths = [neovim-wrapped printConfig printConfigPath];
|
||||
postBuild = "echo Helpers added";
|
||||
|
||||
# Allow evaluating vimOptions, i.e., config.vim from the packages' passthru
|
||||
# Allow evaluating config.vim, i.e., config.vim from the packages' passthru
|
||||
# attribute. For example, packages.x86_64-linux.neovim.passthru.neovimConfig
|
||||
# will return the configuration in full.
|
||||
passthru.neovimConfig = vimOptions;
|
||||
passthru.neovimConfig = config.vim;
|
||||
|
||||
meta =
|
||||
neovim-wrapped.meta
|
||||
|
|
|
@ -140,5 +140,21 @@ in {
|
|||
example = ''["pynvim"]'';
|
||||
description = "List of python packages to install";
|
||||
};
|
||||
|
||||
pluginOverrides = mkOption {
|
||||
type = attrsOf package;
|
||||
default = {};
|
||||
example = ''
|
||||
{
|
||||
lazydev-nvim = pkgs.fetchFromGitHub {
|
||||
owner = "folke";
|
||||
repo = "lazydev.nvim";
|
||||
rev = "";
|
||||
hash = "";
|
||||
};
|
||||
}
|
||||
'';
|
||||
description = "Attribute set of plugins to override default values";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
2008
npins/sources.json
Normal file
2008
npins/sources.json
Normal file
File diff suppressed because it is too large
Load diff
85
npins/sources.nix
Normal file
85
npins/sources.nix
Normal file
|
@ -0,0 +1,85 @@
|
|||
# Based off of:
|
||||
# https://github.com/NixOS/nixpkgs/blob/776c3bee4769c616479393aeefceefeda16b6fcb/pkgs/tools/nix/npins/source.nix
|
||||
{
|
||||
lib,
|
||||
fetchurl,
|
||||
fetchgit,
|
||||
fetchzip,
|
||||
}:
|
||||
builtins.mapAttrs
|
||||
(
|
||||
_: let
|
||||
getZip = {
|
||||
url,
|
||||
hash,
|
||||
...
|
||||
}:
|
||||
fetchzip {
|
||||
inherit url;
|
||||
sha256 = hash;
|
||||
extension = "tar";
|
||||
};
|
||||
mkGitSource = {
|
||||
repository,
|
||||
revision,
|
||||
url ? null,
|
||||
hash,
|
||||
...
|
||||
} @ attrs:
|
||||
assert repository ? type;
|
||||
if url != null
|
||||
then getZip attrs
|
||||
else
|
||||
assert repository.type == "Git"; let
|
||||
urlToName = url: rev: let
|
||||
matched = builtins.match "^.*/([^/]*)(\\.git)?$" repository.url;
|
||||
short = builtins.substring 0 7 rev;
|
||||
appendShort =
|
||||
if (builtins.match "[a-f0-9]*" rev) != null
|
||||
then "-${short}"
|
||||
else "";
|
||||
in "${
|
||||
if matched == null
|
||||
then "source"
|
||||
else builtins.head matched
|
||||
}${appendShort}";
|
||||
name = urlToName repository.url revision;
|
||||
in
|
||||
fetchgit {
|
||||
inherit name;
|
||||
inherit (repository) url;
|
||||
rev = revision;
|
||||
sha256 = hash;
|
||||
};
|
||||
|
||||
mkPyPiSource = {
|
||||
url,
|
||||
hash,
|
||||
...
|
||||
}:
|
||||
fetchurl {
|
||||
inherit url;
|
||||
sha256 = hash;
|
||||
};
|
||||
in
|
||||
spec:
|
||||
assert spec ? type; let
|
||||
func =
|
||||
{
|
||||
Git = mkGitSource;
|
||||
GitRelease = mkGitSource;
|
||||
PyPi = mkPyPiSource;
|
||||
Channel = getZip;
|
||||
}
|
||||
.${spec.type}
|
||||
or (builtins.throw "Unknown source type ${spec.type}");
|
||||
in
|
||||
spec // {outPath = func spec;}
|
||||
)
|
||||
(
|
||||
let
|
||||
json = lib.importJSON ./sources.json;
|
||||
in
|
||||
assert lib.assertMsg (json.version == 3) "Npins version mismatch!";
|
||||
json.pins
|
||||
)
|
Loading…
Add table
Reference in a new issue