mirror of
https://github.com/NotAShelf/neovim-flake.git
synced 2024-12-19 09:49:48 +01:00
lib: move global functions to extended lib
This commit is contained in:
parent
a12ba5689a
commit
51e28d415a
4 changed files with 18 additions and 12 deletions
|
@ -66,8 +66,7 @@
|
||||||
mkSetLuaBinding = binding: action:
|
mkSetLuaBinding = binding: action:
|
||||||
mkLuaBinding binding.value action binding.description;
|
mkLuaBinding binding.value action binding.description;
|
||||||
|
|
||||||
pushDownDefault = attr: mapAttrs (_name: value: mkDefault value) attr;
|
pushDownDefault = attr: mapAttrs (_: value: mkDefault value) attr;
|
||||||
# pushDownDefault = attr: self.mapAttrs (name: value: self.mkDefault value) attr;
|
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
binds
|
binds
|
||||||
|
|
11
lib/config.nix
Normal file
11
lib/config.nix
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
{lib}: let
|
||||||
|
inherit (lib.options) mkOption;
|
||||||
|
inherit (lib.types) bool;
|
||||||
|
in {
|
||||||
|
mkBool = value: description:
|
||||||
|
mkOption {
|
||||||
|
type = bool;
|
||||||
|
default = value;
|
||||||
|
inherit description;
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,5 +1,7 @@
|
||||||
{lib}: {
|
{lib}: {
|
||||||
types = import ./types {inherit lib;};
|
types = import ./types {inherit lib;};
|
||||||
|
|
||||||
|
config = import ./config.nix {inherit lib;};
|
||||||
binds = import ./binds.nix {inherit lib;};
|
binds = import ./binds.nix {inherit lib;};
|
||||||
dag = import ./dag.nix {inherit lib;};
|
dag = import ./dag.nix {inherit lib;};
|
||||||
languages = import ./languages.nix {inherit lib;};
|
languages = import ./languages.nix {inherit lib;};
|
||||||
|
|
|
@ -3,10 +3,10 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (builtins) attrValues attrNames map mapAttrs toJSON isString concatStringsSep filter;
|
inherit (builtins) map mapAttrs toJSON filter;
|
||||||
inherit (lib.options) mkOption;
|
inherit (lib.options) mkOption;
|
||||||
inherit (lib.attrsets) filterAttrs getAttrs;
|
inherit (lib.attrsets) filterAttrs getAttrs attrValues attrNames;
|
||||||
inherit (lib.strings) optionalString;
|
inherit (lib.strings) optionalString isString concatStringsSep;
|
||||||
inherit (lib.misc) mapAttrsFlatten;
|
inherit (lib.misc) mapAttrsFlatten;
|
||||||
inherit (lib.trivial) showWarnings;
|
inherit (lib.trivial) showWarnings;
|
||||||
inherit (lib.types) bool str oneOf attrsOf nullOr attrs submodule lines;
|
inherit (lib.types) bool str oneOf attrsOf nullOr attrs submodule lines;
|
||||||
|
@ -15,6 +15,7 @@
|
||||||
inherit (lib.generators) mkLuaInline;
|
inherit (lib.generators) mkLuaInline;
|
||||||
inherit (lib.nvim.lua) toLuaObject;
|
inherit (lib.nvim.lua) toLuaObject;
|
||||||
inherit (lib.nvim.vim) valToVim;
|
inherit (lib.nvim.vim) valToVim;
|
||||||
|
inherit (lib.nvim.config) mkBool;
|
||||||
|
|
||||||
cfg = config.vim;
|
cfg = config.vim;
|
||||||
|
|
||||||
|
@ -27,13 +28,6 @@
|
||||||
EOF
|
EOF
|
||||||
'';
|
'';
|
||||||
|
|
||||||
mkBool = value: description:
|
|
||||||
mkOption {
|
|
||||||
type = bool;
|
|
||||||
default = value;
|
|
||||||
inherit description;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Most of the keybindings code is highly inspired by pta2002/nixvim. Thank you!
|
# Most of the keybindings code is highly inspired by pta2002/nixvim. Thank you!
|
||||||
mapConfigOptions = {
|
mapConfigOptions = {
|
||||||
silent =
|
silent =
|
||||||
|
|
Loading…
Reference in a new issue