Skip to content

Commit

Permalink
look through sources to get plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHicks committed Sep 10, 2019
1 parent 273f4da commit af3a8df
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 330 deletions.
29 changes: 25 additions & 4 deletions dotfiles/neovim.nix
@@ -1,8 +1,6 @@
{ pkgs, ... }:
{ pkgs, lib, ... }:

let
plugins = pkgs.callPackage ./neovim/plugins.nix { };

similar-sort = pkgs.callPackage ../pkgs/similar-sort { };

smart-gen-tags = pkgs.callPackage ../pkgs/smart-gen-tags { };
Expand All @@ -19,6 +17,29 @@ let
nixfmt =
import (fetchTarball "https://github.com/serokell/nixfmt/archive/e4f31f45799554ff378370256a24f606a3025b0a.tar.gz")
{ };

sources = import ../nix/sources.nix;

vimSources = lib.filterAttrs (_: source: lib.hasAttrByPath [ "vim" ] source) sources;

unpatched = lib.mapAttrs (name: source:
pkgs.vimUtils.buildVimPlugin {
name = name;
src = source;
}) vimSources;

plugins = unpatched // {
ale = unpatched.ale.overrideAttrs (attrs: {
patches = [
(pkgs.fetchpatch {
url = "https://patch-diff.githubusercontent.com/raw/dense-analysis/ale/pull/2750.patch";
sha256 = "075zrk6njjya62kzkr24px9l02n77si50z2pnxnm03l2cmrm3ffw";
})
];
});

delimitMate = unpatched.delimitMate.overrideAttrs (attrs: { buildInputs = [ pkgs.zip pkgs.vim ]; });
};
in {
programs.neovim = {
enable = true;
Expand Down Expand Up @@ -342,7 +363,7 @@ in {
inoremap <expr> <CR> pumvisible() ? "\<C-e>\<CR>" : "\<CR>"
'';

packages.myVimPackage.start = plugins.all ++ [ pkgs.fzf ];
packages.myVimPackage.start = (lib.mapAttrsToList (_: plugin: plugin) plugins) ++ [ pkgs.fzf ];
};
};
}
326 changes: 0 additions & 326 deletions dotfiles/neovim/plugins.nix

This file was deleted.

0 comments on commit af3a8df

Please sign in to comment.