plugins/neorg: use neorgTelescopePackage option

This commit is contained in:
Austin Horstman 2024-09-14 12:16:15 -05:00
parent 7a9bb2ee95
commit e3e3774177
No known key found for this signature in database
2 changed files with 25 additions and 3 deletions

View file

@ -20,6 +20,11 @@ with lib;
];
};
neorgTelescopePackage = lib.mkPackageOption pkgs [
"vimPlugins"
"neorg-telescope"
] { nullable = true; };
lazyLoading = helpers.defaultNullOpts.mkBool false '''';
logger =
@ -148,12 +153,18 @@ with lib;
Telescope support for neorg (`core.integrations.telescope`) is enabled but the
telescope plugin is not.
'')
++ (optional (telescopeSupport && (cfg.neorgTelescopePackage == null)) ''
Telescope support for neorg (`core.integrations.telescope`) is enabled but the
`neorgTelescopePackage` package is not set.
'')
++ (optional ((hasAttr "core.defaults" cfg.modules) && (!config.plugins.treesitter.enable)) ''
Neorg's `core.defaults` module is enabled but `plugins.treesitter` is not.
Treesitter is required when using the `core.defaults`.
'');
extraPlugins = [ cfg.package ] ++ (optional telescopeSupport pkgs.vimPlugins.neorg-telescope);
extraPlugins = [
cfg.package
] ++ (optional (telescopeSupport && cfg.neorgTelescopePackage != null) cfg.neorgTelescopePackage);
extraConfigLua = ''
require('neorg').setup(${helpers.toLuaObject setupOptions})

View file

@ -75,13 +75,24 @@
};
telescope-integration = {
# TODO: re-enable when this will have been fixed upstream.
test.runNvim = false;
plugins = {
telescope.enable = false;
telescope.enable = true;
neorg = {
enable = false;
enable = true;
modules."core.integrations.telescope".__empty = null;
};
};
};
no-packages = {
# TODO: re-enable when this will have been fixed upstream.
test.runNvim = false;
plugins.neorg = {
enable = true;
neorgTelescopePackage = null;
};
};
}