feat: add lib function to quickly mkIf bindings

This commit is contained in:
n3oney 2023-04-11 14:38:08 +02:00
parent 13783d3d12
commit 2d9b24dfdb
No known key found for this signature in database
GPG key ID: C786693DE727850E

View file

@ -7,6 +7,23 @@ in
nixpkgsLib.extend (self: super: {
nvim = mkNvimLib {lib = self;};
mkLuaBinding = key: action: desc:
self.mkIf (key != null) {
"${key}" = {
inherit action desc;
lua = true;
silent = true;
};
};
mkBinding = key: action: desc:
self.mkIf (key != null) {
"${key}" = {
inherit action desc;
silent = true;
};
};
# For forward compatibility.
literalExpression = super.literalExpression or super.literalExample;
literalDocBook = super.literalDocBook or super.literalExample;