2023-10-18 09:19:46 +01:00
|
|
|
{
|
|
|
|
lib,
|
2023-11-06 15:04:08 +01:00
|
|
|
helpers,
|
|
|
|
config,
|
|
|
|
pkgs,
|
2023-10-18 09:19:46 +01:00
|
|
|
...
|
|
|
|
}:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.plugins.nix-develop;
|
|
|
|
in
|
|
|
|
{
|
2024-01-25 16:15:55 +01:00
|
|
|
options.plugins.nix-develop = helpers.neovim-plugin.extraOptionsOptions // {
|
2023-10-18 09:19:46 +01:00
|
|
|
enable = mkEnableOption "nix-develop.nvim";
|
|
|
|
|
2024-05-17 14:09:20 +02:00
|
|
|
package = helpers.mkPluginPackageOption "nix-develop.nvim" pkgs.vimPlugins.nix-develop-nvim;
|
2023-10-18 09:19:46 +01:00
|
|
|
|
|
|
|
ignoredVariables = mkOption {
|
|
|
|
type = types.attrsOf types.bool;
|
|
|
|
default = { };
|
|
|
|
};
|
|
|
|
|
|
|
|
separatedVariables = mkOption {
|
|
|
|
type = types.attrsOf types.str;
|
|
|
|
default = { };
|
|
|
|
};
|
2024-05-05 19:39:35 +02:00
|
|
|
};
|
2023-10-18 09:19:46 +01:00
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
extraPlugins = [ cfg.package ];
|
|
|
|
extraConfigLua = ''
|
|
|
|
local __ignored_variables = ${helpers.toLuaObject cfg.ignoredVariables}
|
|
|
|
for ignoredVariable, shouldIgnore in ipairs(__ignored_variables) do
|
|
|
|
require("nix-develop").ignored_variables[ignoredVariable] = shouldIgnore
|
|
|
|
end
|
|
|
|
|
|
|
|
local __separated_variables = ${helpers.toLuaObject cfg.separatedVariables}
|
|
|
|
for variable, separator in ipairs(__separated_variables) do
|
|
|
|
require("nix-develop").separated_variables[variable] = separator
|
|
|
|
end
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|