This repository has been archived on 2024-05-17. You can view files and clone it, but cannot push or open issues or pull requests.
neovim/flake.nix

213 lines
5.6 KiB
Nix

{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
# Plenary (required by crates-nvim)
plenary-nvim = {
url = "github:nvim-lua/plenary.nvim";
flake = false;
};
# config
# https://github.com/gpanders/editorconfig.nvim
editorconfig-nvim = {
url = "github:gpanders/editorconfig.nvim?rev=7d10fe6bc340fd783c0b61cf627dd235100284db";
flake = false;
};
# explorer
# https://github.com/kyazdani42/nvim-tree.lua
nvim-tree-lua = {
url = "github:kyazdani42/nvim-tree.lua?rev=0417d9148b6546bf4883b6e9750f992f980afbfe";
flake = false;
};
# https://github.com/nvim-telescope/telescope.nvim
telescope-nvim = {
url = "github:nvim-telescope/telescope.nvim?rev=30e2dc5232d0dd63709ef8b44a5d6184005e8602";
flake = false;
};
# https://github.com/nvim-telescope/telescope-live-grep-args.nvim
telescope-live-grep-args-nvim = {
url = "github:nvim-telescope/telescope-live-grep-args.nvim?rev=32b633b062d1168a2d18ad27994e5b4ef97f0a74";
flake = false;
};
# formatter
# https://github.com/sbdchd/neoformat
neoformat = {
url = "github:sbdchd/neoformat?rev=0ae951121da29a157d80db70c32679b428afffdc";
flake = false;
};
# git
# https://github.com/lewis6991/gitsigns.nvim
gitsigns-nvim = {
url = "github:lewis6991/gitsigns.nvim?rev=f98c85e7c3d65a51f45863a34feb4849c82f240f";
flake = false;
};
# lsp
# https://github.com/neovim/nvim-lspconfig
nvim-lspconfig = {
url = "github:neovim/nvim-lspconfig?rev=d4eb971db353ccf78cefb3be1b05483b69ec1e69";
flake = false;
};
# https://github.com/glepnir/lspsaga.nvim
lspsaga-nvim = {
url = "github:glepnir/lspsaga.nvim?rev=c2ef0115fb917460daf5c76fe3ad3a9357213b54";
flake = false;
};
# https://github.com/L3MON4D3/LuaSnip
luaship = {
url = "github:L3MON4D3/LuaSnip?rev=d36c063b7f6e701852f7880f1314656592a61b4f";
flake = false;
};
# https://github.com/hrsh7th/nvim-cmp
nvim-cmp = {
url = "github:hrsh7th/nvim-cmp?rev=17a55b3d5498c617855d015bbcad0c872d10c879";
flake = false;
};
# https://github.com/hrsh7th/cmp-nvim-lsp
cmp-nvim-lsp = {
url = "github:hrsh7th/cmp-nvim-lsp?rev=affe808a5c56b71630f17aa7c38e15c59fd648a8";
flake = false;
};
# https://github.com/saadparwaiz1/cmp_luasnip
cmp-luasnip = {
url = "github:saadparwaiz1/cmp_luasnip?rev=a9de941bcbda508d0a45d28ae366bb3f08db2e36";
flake = false;
};
# syntax
# https://github.com/nvim-treesitter/nvim-treesitter
nvim-treesitter = {
url = "github:nvim-treesitter/nvim-treesitter?rev=a60aa7b2e1dd9219c6356f65ba48bdbd50090abd";
flake = false;
};
# theme
# https://github.com/nanozuki/tabby.nvim
tabby-nvim = {
url = "github:nanozuki/tabby.nvim?rev=916c9e56d043906a441cd9f905e2ca1f5c4dddb0";
flake = false;
};
# https://github.com/nvim-lualine/lualine.nvim
lualine-nvim = {
url = "github:nvim-lualine/lualine.nvim?rev=a52f078026b27694d2290e34efa61a6e4a690621";
flake = false;
};
# https://github.com/arkav/lualine-lsp-progress
lualine-lsp-progress = {
url = "github:/arkav/lualine-lsp-progress?rev=56842d097245a08d77912edf5f2a69ba29f275d7";
flake = false;
};
# https://github.com/kyazdani42/nvim-web-devicons
nvim-web-devicons = {
url = "github:kyazdani42/nvim-web-devicons?rev=969728506c0175644a1d448f55e311ccdada7eaf";
flake = false;
};
# https://github.com/catppuccin/nvim
theme = {
url = "github:catppuccin/nvim?rev=9ac18414f0446478024b19018d73b7ea14f6fc96";
flake = false;
};
};
outputs = inputs @ { self, nixpkgs, utils, ... }:
let
inputPlugins = [
"plenary-nvim"
# config
"editorconfig-nvim"
# explorer
"nvim-tree-lua"
"telescope-nvim"
"telescope-live-grep-args-nvim"
# formatter
"neoformat"
# git
"gitsigns-nvim"
# lsp
"nvim-lspconfig"
"lspsaga-nvim"
"luaship"
"nvim-cmp"
"cmp-nvim-lsp"
"cmp-luasnip"
# syntax
"nvim-treesitter"
# theme
"tabby-nvim"
"lualine-nvim"
"lualine-lsp-progress"
"nvim-web-devicons"
"theme"
];
mkNvimPlugins = { lib, vimUtils, vimPlugins, ... }:
let
inherit (builtins) getAttr;
inherit (lib) listToAttrs nameValuePair;
buildPlugin = name: vimUtils.buildVimPluginFrom2Nix {
name = name;
src = getAttr name inputs;
};
buildPluginValuePair = n: nameValuePair n (buildPlugin n);
customPlugins = listToAttrs (map buildPluginValuePair inputPlugins);
in
{ vimPlugins = vimPlugins // customPlugins; };
in
{
overlays = {
default = final: prev: {
myneovim = prev.callPackage ./. (mkNvimPlugins prev);
};
};
} //
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
neovim = pkgs.callPackage ./. (mkNvimPlugins pkgs);
in
{
apps.default = {
type = "app";
program = "${neovim}/bin/nvim";
};
packages.default = neovim;
devShells.default = pkgs.mkShell {
packages = [
(neovim.override {
enableDevIcons = true;
enableTabby = true;
})
pkgs.stylua # lua formatter
];
};
});
}