marleyvim/nix/neovim-overlay.nix

93 lines
2.4 KiB
Nix
Raw Normal View History

2024-11-27 20:38:07 -08:00
# This overlay, when applied to nixpkgs, adds the final neovim derivation to nixpkgs.
{inputs}: final: prev:
with final.pkgs.lib; let
pkgs = final;
# Use this to create a plugin from a flake input
2024-11-28 21:14:59 -08:00
# mkNvimPlugin = src: pname:
# pkgs.vimUtils.buildVimPlugin {
# inherit pname src;
# version = src.lastModifiedDate;
# };
2024-11-27 20:38:07 -08:00
# Make sure we use the pinned nixpkgs instance for wrapNeovimUnstable,
# otherwise it could have an incompatible signature when applying this overlay.
pkgs-wrapNeovim = inputs.nixpkgs.legacyPackages.${pkgs.system};
# This is the helper function that builds the Neovim derivation.
2024-11-28 11:11:51 -08:00
mkNeovim = pkgs.callPackage ./mkNeovim.nix {inherit pkgs-wrapNeovim;};
2024-11-27 20:38:07 -08:00
# A plugin can either be a package or an attrset, such as
# { plugin = <plugin>; # the package, e.g. pkgs.vimPlugins.nvim-cmp
# config = <config>; # String; a config that will be loaded with the plugin
# # Boolean; Whether to automatically load the plugin as a 'start' plugin,
# # or as an 'opt' plugin, that can be loaded with `:packadd!`
# optional = <true|false>; # Default: false
# ...
# }
all-plugins = with pkgs.vimPlugins; [
# bleeding-edge plugins from flake inputs
2024-11-28 11:37:22 -08:00
# (mkNvimPlugin inputs.wf-nvim "wf.nvim") # (example) keymap hints
2024-11-28 21:14:59 -08:00
# Base
2024-11-28 20:30:20 -08:00
lz-n
snacks-nvim
2024-11-29 18:07:52 -08:00
2024-11-30 11:08:42 -08:00
# Util
plenary-nvim
2024-11-30 17:40:46 -08:00
nui-nvim
2024-11-30 18:10:09 -08:00
persistence-nvim
2024-11-30 11:08:42 -08:00
2024-11-30 11:31:11 -08:00
# Colorscheme
rose-pine
2024-11-29 18:07:52 -08:00
# UI
mini-icons
2024-11-30 11:08:42 -08:00
alpha-nvim
2024-11-29 18:08:02 -08:00
bufferline-nvim
2024-11-30 12:51:28 -08:00
lualine-nvim
2024-11-30 17:40:46 -08:00
noice-nvim
2024-11-30 13:03:29 -08:00
indent-blankline-nvim
2024-12-01 11:05:41 -08:00
# Editor
neo-tree-nvim
2024-11-27 20:38:07 -08:00
];
extraPackages = with pkgs; [
2024-11-28 21:14:59 -08:00
# System packages
2024-11-28 13:13:57 -08:00
ripgrep
2024-11-28 20:30:20 -08:00
lazygit
2024-11-28 21:14:59 -08:00
# Language servers
2024-11-27 20:38:07 -08:00
lua-language-server
2024-11-28 13:13:57 -08:00
nixd
2024-11-27 20:38:07 -08:00
];
in {
2024-11-28 11:37:22 -08:00
# This is the neovim derivation returned by the overlay.
2024-11-27 20:38:07 -08:00
nvim-pkg = mkNeovim {
plugins = all-plugins;
2024-11-28 11:30:25 -08:00
neovim-unwrapped = inputs.neovim-nightly.packages.${pkgs.system}.default;
2024-11-27 20:38:07 -08:00
inherit extraPackages;
};
2024-11-28 11:37:22 -08:00
# This can be symlinked in the devShell's shellHook.
2024-11-27 20:38:07 -08:00
nvim-luarc-json = final.mk-luarc-json {
plugins = all-plugins;
};
# You can add as many derivations as you like.
# Use `ignoreConfigRegexes` to filter out config
# files you would not like to include.
#
# For example:
#
# nvim-pkg-no-telescope = mkNeovim {
# plugins = [];
# ignoreConfigRegexes = [
# "^plugin/telescope.lua"
# "^ftplugin/.*.lua"
# ];
# inherit extraPackages;
# };
}