Skip to content

Instantly share code, notes, and snippets.

@phrmendes
Created September 10, 2023 03:29
Show Gist options
  • Save phrmendes/4ded5ff7fb59c22b11f91759023306f5 to your computer and use it in GitHub Desktop.
Save phrmendes/4ded5ff7fb59c22b11f91759023306f5 to your computer and use it in GitHub Desktop.
Download neovim plugins from GitHub using Nix and home-manager
{
pkgs,
lib,
...
}: let
fromGitHub = ref: repo:
pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "${lib.strings.sanitizeDerivationName repo}";
version = ref;
src = builtins.fetchGit {
inherit ref;
url = "https://github.com/${repo}.git";
};
};
in {
programs.neovim = {
enable = true;
package = pkgs.neovim-unwrapped;
vimAlias = true;
vimdiffAlias = true;
withNodeJs = true;
withPython3 = true;
plugins = with pkgs.vimPlugins; [
(fromGitHub "HEAD" "user/repo")
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment