This commit is contained in:
NotAShelf 2023-07-31 13:16:45 +03:00
parent 7183ff87ef
commit d2edfcc24b
No known key found for this signature in database
GPG Key ID: 02D1DD3FA08B6B29
6 changed files with 17 additions and 10 deletions

View File

@ -24,9 +24,7 @@
];
flake = {
lib = let
nixpkgsLib = import nixpkgs.lib;
in {
lib = {
inherit (import ./lib/stdlib-extended.nix nixpkgs.lib inputs) nvim;
inherit (import ./configuration.nix inputs) neovimConfiguration;
};

View File

@ -1,4 +1,6 @@
{lib}: rec {
{lib}: let
inherit (lib) types;
in rec {
mkLuaBinding = key: action: desc:
lib.mkIf (key != null) {
"${key}" = {
@ -28,7 +30,7 @@
mkMappingOption = description: default:
lib.mkOption {
type = lib.types.nullOrlib.types.str;
type = with types; nullOr str;
inherit default description;
};

View File

@ -9,4 +9,8 @@
nmd = import ./nmd.nix;
lua = import ./lua.nix {inherit lib;};
binds = import ./binds.nix {inherit lib;};
imports = [
(import ./binds.nix {inherit lib;})
];
}

View File

@ -8,15 +8,17 @@ with lib; let
(n: v: nameValuePair (removePrefix prefix n) {src = v;})
(filterAttrs (n: _: hasPrefix prefix n) inputs);
rawPlugins = fromInputs inputs "plugin-";
# Define the helper function to extract the names from the name-value pairs
getNames = list: mapAttrsToList (name: _: name) list;
rawPlugins = fromInputs inputs "plugin-";
# Map all plugin names to a list for pluginType to select from
mappedPluginList = getNames rawPlugins;
finalPluginList = mappedPluginList ++ ["nvim-treesitter"];
# Append plugins that are not in the mappedPluginList to the plugin list
finalPluginList = mappedPluginList ++ ["nvim-treesitter" "flutter-tools-patched"];
# either a package from nixpkgs, or a plugin from inputs ( + "nvim-treesitter")
pluginType = with types;

View File

@ -5,7 +5,7 @@ with builtins; {
autocomplete = {
enable = mkEnableOption "enable autocomplete" // {default = false;};
mappings = {
mappings = with nvim.binds; {
complete = mkMappingOption "Complete [nvim-cmp]" "<C-Space>";
confirm = mkMappingOption "Confirm [nvim-cmp]" "<CR>";
next = mkMappingOption "Next item [nvim-cmp]" "<Tab>";

View File

@ -3,7 +3,8 @@
lib,
...
}:
with lib; let
with lib;
with nvim.binds; let
cfg = config.vim.utility.motion.leap;
in {
config = mkIf cfg.enable {