Declaratively manage plugins not in nixpkgs

Created the plugins/plugin-defs.nix file, which will include
definitions for all plugins not in nixpkgs. This way, we can get
rid of the packer dependency and make the whole thing truly
declarative!
This commit is contained in:
Pedro Alves 2021-12-12 12:39:08 +00:00
parent 5249bd7420
commit ff824e9dba
2 changed files with 19 additions and 6 deletions

16
plugins/plugin-defs.nix Normal file
View file

@ -0,0 +1,16 @@
# This is for plugins not in nixpkgs
# e.g. intellitab.nvim
# Ideally, in the future, this would all be specified as a flake input!
{ pkgs, ... }:
{
intellitab-nvim = pkgs.vimUtils.buildVimPlugin rec {
pname = "intellitab-nvim";
version = "a6c1a505865f6131866d609c52440306e9914b16";
src = pkgs.fetchFromGitHub {
owner = "pta2002";
repo = "intellitab.nvim";
rev = version;
sha256 = "19my464jsji7cb81h0agflzb0vmmb3f5kapv0wwhpdddcfzvp4fg";
};
};
}

View file

@ -2,7 +2,7 @@
with lib; with lib;
let let
cfg = config.programs.nixvim.plugins.comment-nvim; cfg = config.programs.nixvim.plugins.comment-nvim;
helpers = import ../helpers.nix { inherit lib; }; defs = import ../plugin-defs.nix { inherit pkgs; };
in in
{ {
options = { options = {
@ -13,12 +13,9 @@ in
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.nixvim = { programs.nixvim = {
maps.insert."<Tab>" = "<CMD>lua require([[intellitab]]).indent()<CR>"; extraPlugins = [ defs.intellitab-nvim ];
plugins.packer = {
enable = true;
plugins = [ "pta2002/intellitab.nvim" ];
};
maps.insert."<Tab>" = "<CMD>lua require([[intellitab]]).indent()<CR>";
plugins.treesitter = { plugins.treesitter = {
indent = true; indent = true;
}; };