plugins/netman: init + tests (#255)

Netman tests don't work if we try to effectively execute the config, so
a new parameter to `checkConfig` is introduced, `dontRun` that allows to
skip this phase.
This commit is contained in:
traxys 2023-03-17 10:00:22 +01:00 committed by GitHub
parent 6544e32396
commit 02fcb49a03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 85 additions and 0 deletions

View file

@ -99,6 +99,26 @@
}, },
"version": "d7fb84a670795a5b36b18a5b59afd1d3865cbec7" "version": "d7fb84a670795a5b36b18a5b59afd1d3865cbec7"
}, },
"netman-nvim": {
"cargoLocks": null,
"date": "2023-03-02",
"extract": null,
"name": "netman-nvim",
"passthru": null,
"pinned": false,
"src": {
"deepClone": false,
"fetchSubmodules": false,
"leaveDotGit": false,
"name": null,
"owner": "miversen33",
"repo": "netman.nvim",
"rev": "1ef50efcbe88f8293e97946af37243a20873bb1c",
"sha256": "sha256-oRjBjVmO/7bmgyf9ltthRrwZBD5SLD757GklSjw1bJs=",
"type": "github"
},
"version": "1ef50efcbe88f8293e97946af37243a20873bb1c"
},
"nvim-osc52": { "nvim-osc52": {
"cargoLocks": null, "cargoLocks": null,
"date": "2023-03-03", "date": "2023-03-03",

View file

@ -61,6 +61,18 @@
}); });
date = "2021-06-22"; date = "2021-06-22";
}; };
netman-nvim = {
pname = "netman-nvim";
version = "1ef50efcbe88f8293e97946af37243a20873bb1c";
src = fetchFromGitHub ({
owner = "miversen33";
repo = "netman.nvim";
rev = "1ef50efcbe88f8293e97946af37243a20873bb1c";
fetchSubmodules = false;
sha256 = "sha256-oRjBjVmO/7bmgyf9ltthRrwZBD5SLD757GklSjw1bJs=";
});
date = "2023-03-02";
};
nvim-osc52 = { nvim-osc52 = {
pname = "nvim-osc52"; pname = "nvim-osc52";
version = "47ce7ee2396fa3ee4fb6b0e0ef14ba06f9c9bd31"; version = "47ce7ee2396fa3ee4fb6b0e0ef14ba06f9c9bd31";

View file

@ -66,6 +66,7 @@
./utils/neo-tree.nix ./utils/neo-tree.nix
./utils/neorg.nix ./utils/neorg.nix
./utils/notify.nix ./utils/notify.nix
./utils/netman.nix
./utils/nvim-autopairs.nix ./utils/nvim-autopairs.nix
./utils/nvim-bqf.nix ./utils/nvim-bqf.nix
./utils/nvim-colorizer.nix ./utils/nvim-colorizer.nix

View file

@ -29,3 +29,7 @@ fetch.github = "WhiteBlackGoose/magma-nvim-goose"
[nvim-osc52] [nvim-osc52]
src.git = "https://github.com/ojroques/nvim-osc52" src.git = "https://github.com/ojroques/nvim-osc52"
fetch.github = "ojroques/nvim-osc52" fetch.github = "ojroques/nvim-osc52"
[netman-nvim]
src.git = "https://github.com/miversen33/netman.nvim"
fetch.github = "miversen33/netman.nvim"

View file

@ -74,4 +74,8 @@ in {
nvim-osc52 = pkgs.vimUtils.buildVimPlugin { nvim-osc52 = pkgs.vimUtils.buildVimPlugin {
inherit (sources.nvim-osc52) pname version src; inherit (sources.nvim-osc52) pname version src;
}; };
netman-nvim = pkgs.vimUtils.buildVimPlugin {
inherit (sources.netman-nvim) pname version src;
};
} }

29
plugins/utils/netman.nix Normal file
View file

@ -0,0 +1,29 @@
{
config,
lib,
pkgs,
...
} @ args: let
defs = import ../plugin-defs.nix {inherit pkgs;};
helpers = import ../helpers.nix args;
in
with lib; {
options.plugins.netman = {
enable = mkEnableOption "netman.nvim, a framework to access remote resources";
package = helpers.mkPackageOption "netman.nvim" defs.netman-nvim;
neoTreeIntegration = mkEnableOption "support for netman as a neo-tree source";
};
config = let
cfg = config.plugins.netman;
in
mkIf cfg.enable {
extraPlugins = [cfg.package];
extraConfigLua = ''
require("netman")
'';
plugins.neo-tree.extraSources = mkIf cfg.neoTreeIntegration ["netman.ui.neo-tree"];
};
}

15
tests/plugins/netman.nix Normal file
View file

@ -0,0 +1,15 @@
{
empty = {
tests.dontRun = true;
plugins.netman.enable = true;
};
withNeotree = {
tests.dontRun = true;
plugins.neo-tree.enable = true;
plugins.netman = {
enable = true;
neoTreeIntegration = true;
};
};
}