mirror of
https://github.com/NotAShelf/nvf.git
synced 2024-11-22 13:20:44 +00: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:
|
||||
mkLuaBinding binding.value action binding.description;
|
||||
|
||||
pushDownDefault = attr: mapAttrs (_name: value: mkDefault value) attr;
|
||||
# pushDownDefault = attr: self.mapAttrs (name: value: self.mkDefault value) attr;
|
||||
pushDownDefault = attr: mapAttrs (_: value: mkDefault value) attr;
|
||||
};
|
||||
in
|
||||
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}: {
|
||||
types = import ./types {inherit lib;};
|
||||
|
||||
config = import ./config.nix {inherit lib;};
|
||||
binds = import ./binds.nix {inherit lib;};
|
||||
dag = import ./dag.nix {inherit lib;};
|
||||
languages = import ./languages.nix {inherit lib;};
|
||||
|
|
|
@ -3,10 +3,10 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (builtins) attrValues attrNames map mapAttrs toJSON isString concatStringsSep filter;
|
||||
inherit (builtins) map mapAttrs toJSON filter;
|
||||
inherit (lib.options) mkOption;
|
||||
inherit (lib.attrsets) filterAttrs getAttrs;
|
||||
inherit (lib.strings) optionalString;
|
||||
inherit (lib.attrsets) filterAttrs getAttrs attrValues attrNames;
|
||||
inherit (lib.strings) optionalString isString concatStringsSep;
|
||||
inherit (lib.misc) mapAttrsFlatten;
|
||||
inherit (lib.trivial) showWarnings;
|
||||
inherit (lib.types) bool str oneOf attrsOf nullOr attrs submodule lines;
|
||||
|
@ -15,6 +15,7 @@
|
|||
inherit (lib.generators) mkLuaInline;
|
||||
inherit (lib.nvim.lua) toLuaObject;
|
||||
inherit (lib.nvim.vim) valToVim;
|
||||
inherit (lib.nvim.config) mkBool;
|
||||
|
||||
cfg = config.vim;
|
||||
|
||||
|
@ -27,13 +28,6 @@
|
|||
EOF
|
||||
'';
|
||||
|
||||
mkBool = value: description:
|
||||
mkOption {
|
||||
type = bool;
|
||||
default = value;
|
||||
inherit description;
|
||||
};
|
||||
|
||||
# Most of the keybindings code is highly inspired by pta2002/nixvim. Thank you!
|
||||
mapConfigOptions = {
|
||||
silent =
|
||||
|
|
Loading…
Reference in a new issue