mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
plugins/utils: move to by-name
This commit is contained in:
parent
faff32b9f1
commit
52f125679f
195 changed files with 2 additions and 102 deletions
61
plugins/by-name/nix-develop/default.nix
Normal file
61
plugins/by-name/nix-develop/default.nix
Normal file
|
@ -0,0 +1,61 @@
|
|||
{
|
||||
lib,
|
||||
helpers,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.plugins.nix-develop;
|
||||
in
|
||||
{
|
||||
options.plugins.nix-develop = helpers.neovim-plugin.extraOptionsOptions // {
|
||||
enable = mkEnableOption "nix-develop.nvim";
|
||||
|
||||
package = lib.mkPackageOption pkgs "nix-develop.nvim" {
|
||||
default = [
|
||||
"vimPlugins"
|
||||
"nix-develop-nvim"
|
||||
];
|
||||
};
|
||||
|
||||
ignoredVariables = mkOption {
|
||||
type = with types; attrsOf bool;
|
||||
default = { };
|
||||
description = "An attrs specifying the variables should be ignored.";
|
||||
example = {
|
||||
BASHOPTS = true;
|
||||
HOME = true;
|
||||
NIX_BUILD_TOP = true;
|
||||
SHELL = true;
|
||||
TMP = true;
|
||||
};
|
||||
};
|
||||
|
||||
separatedVariables = mkOption {
|
||||
type = with types; attrsOf str;
|
||||
default = { };
|
||||
description = "An attrs specifying the separator to use for particular environment variables.";
|
||||
example = {
|
||||
PATH = ":";
|
||||
XDG_DATA_DIRS = ":";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
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
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue