2023-02-20 11:42:13 +01:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
...
|
2023-01-06 16:14:30 +01:00
|
|
|
}:
|
2023-02-20 11:42:13 +01:00
|
|
|
with lib; let
|
|
|
|
helpers = import ../helpers.nix {inherit lib;};
|
2023-01-25 19:46:49 +01:00
|
|
|
in {
|
2023-01-06 16:14:30 +01:00
|
|
|
options.plugins.plantuml-syntax = {
|
2023-01-22 03:32:08 +00:00
|
|
|
enable = mkEnableOption "plantuml syntax support";
|
2023-01-19 10:45:15 +00:00
|
|
|
|
2023-01-25 19:46:49 +01:00
|
|
|
package = helpers.mkPackageOption "plantuml-syntax" pkgs.vimPlugins.plantuml-syntax;
|
2023-01-19 10:45:15 +00:00
|
|
|
|
2023-01-06 16:14:30 +01:00
|
|
|
setMakeprg = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = true;
|
|
|
|
description = "Set the makeprg to 'plantuml'";
|
|
|
|
};
|
|
|
|
executableScript = mkOption {
|
|
|
|
type = types.nullOr types.str;
|
|
|
|
default = null;
|
|
|
|
description = "Set the script to be called with makeprg, default to 'plantuml' in PATH";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-02-20 11:42:13 +01:00
|
|
|
config = let
|
|
|
|
cfg = config.plugins.plantuml-syntax;
|
|
|
|
in
|
2023-01-06 16:14:30 +01:00
|
|
|
mkIf cfg.enable {
|
2023-02-20 11:42:13 +01:00
|
|
|
extraPlugins = [cfg.package];
|
2023-01-06 16:14:30 +01:00
|
|
|
|
|
|
|
globals = {
|
|
|
|
plantuml_set_makeprg = cfg.setMakeprg;
|
|
|
|
plantuml_executable_script = cfg.executableScript;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|