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

83 lines
2.1 KiB
Nix
Raw Normal View History

2022-09-15 01:22:06 +03:00
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
2022-09-19 18:44:57 +03:00
tabby-nvim = {
url = "github:nanozuki/tabby.nvim?rev=916c9e56d043906a441cd9f905e2ca1f5c4dddb0";
flake = false;
};
2022-09-19 19:03:40 +03:00
editorconfig-nvim = {
url = "github:gpanders/editorconfig.nvim?rev=7d10fe6bc340fd783c0b61cf627dd235100284db";
flake = false;
};
telescope-live-grep-args-nvim = {
url = "github:nvim-telescope/telescope-live-grep-args.nvim?rev=32b633b062d1168a2d18ad27994e5b4ef97f0a74";
flake = false;
};
2022-09-19 20:43:20 +03:00
lspsaga-nvim = {
url = "github:glepnir/lspsaga.nvim?rev=c2ef0115fb917460daf5c76fe3ad3a9357213b54";
flake = false;
};
2022-09-15 01:22:06 +03:00
};
2022-09-19 18:44:57 +03:00
outputs = inputs @ { self, nixpkgs, utils, ... }:
2022-09-15 01:22:06 +03:00
utils.lib.eachDefaultSystem (system:
let
2022-09-20 09:17:40 +03:00
inputPlugins = [
"tabby-nvim"
"editorconfig-nvim"
"telescope-live-grep-args-nvim"
"lspsaga-nvim"
];
2022-09-19 18:44:57 +03:00
pkgs = import nixpkgs {
inherit system;
overlays = [
2022-09-20 09:17:40 +03:00
(f: p:
let
inherit (p.lib) listToAttrs nameValuePair;
buildPlugin = name: p.vimUtils.buildVimPluginFrom2Nix {
name = name;
src = builtins.getAttr name inputs;
2022-09-19 20:43:20 +03:00
};
2022-09-19 18:44:57 +03:00
2022-09-20 09:17:40 +03:00
buildPluginValuePair = n: nameValuePair n (buildPlugin n);
customPlugins = listToAttrs (builtins.map buildPluginValuePair inputPlugins);
in
{ vimPlugins = p.vimPlugins // customPlugins; }
)
];
2022-09-19 18:44:57 +03:00
};
2022-09-15 01:22:06 +03:00
2022-09-15 01:29:25 +03:00
neovim = pkgs.callPackage ./. { };
2022-09-15 01:22:06 +03:00
in
{
2022-09-17 17:52:12 +03:00
apps.default = {
type = "app";
program = "${neovim}/bin/nvim";
};
packages.default = neovim;
2022-09-15 01:22:06 +03:00
devShells.default = pkgs.mkShell {
2022-09-16 23:42:53 +03:00
packages = [
2022-09-19 18:44:57 +03:00
(neovim.override {
enableDevIcons = true;
enableTabby = true;
})
2022-09-16 23:42:53 +03:00
pkgs.stylua # lua formatter
];
2022-09-15 01:22:06 +03:00
};
2022-09-17 17:52:12 +03:00
overlays = f: p: {
myneovim = neovim;
};
2022-09-15 01:22:06 +03:00
});
}