-
-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
plugins/netman: migrate to mkNeovimPlugin
- Loading branch information
1 parent
1d0404f
commit d99bc6e
Showing
1 changed file
with
15 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,26 @@ | ||
{ | ||
lib, | ||
config, | ||
pkgs, | ||
... | ||
}: | ||
{ | ||
options.plugins.netman = { | ||
enable = lib.mkEnableOption "netman.nvim, a framework to access remote resources"; | ||
lib.nixvim.neovim-plugin.mkNeovimPlugin { | ||
name = "netman"; | ||
originalName = "netman.nvim"; | ||
package = "netman-nvim"; | ||
|
||
hasSettings = false; | ||
callSetup = false; | ||
|
||
package = lib.mkPackageOption pkgs "netman.nvim" { | ||
default = [ | ||
"vimPlugins" | ||
"netman-nvim" | ||
]; | ||
}; | ||
maintainers = [ lib.maintainers.khaneliman ]; | ||
|
||
extraOptions = { | ||
neoTreeIntegration = lib.mkEnableOption "support for netman as a neo-tree source"; | ||
}; | ||
|
||
config = | ||
let | ||
cfg = config.plugins.netman; | ||
in | ||
lib.mkIf cfg.enable { | ||
extraPlugins = [ cfg.package ]; | ||
extraConfigLua = '' | ||
require("netman") | ||
''; | ||
extraConfig = cfg: { | ||
plugins.netman.luaConfig.content = '' | ||
require("netman") | ||
''; | ||
|
||
plugins.neo-tree.extraSources = lib.mkIf cfg.neoTreeIntegration [ "netman.ui.neo-tree" ]; | ||
}; | ||
plugins.neo-tree.extraSources = lib.mkIf cfg.neoTreeIntegration [ "netman.ui.neo-tree" ]; | ||
}; | ||
} |