2023-02-06 18:57:35 +00:00
|
|
|
# From home-manager: https://github.com/nix-community/home-manager/blob/master/modules/lib/stdlib-extended.nix
|
|
|
|
# Just a convenience function that returns the given Nixpkgs standard
|
|
|
|
# library extended with the HM library.
|
|
|
|
nixpkgsLib: let
|
|
|
|
mkNvimLib = import ./.;
|
|
|
|
in
|
|
|
|
nixpkgsLib.extend (self: super: {
|
|
|
|
nvim = mkNvimLib {lib = self;};
|
|
|
|
|
2023-04-11 12:38:08 +00:00
|
|
|
mkLuaBinding = key: action: desc:
|
|
|
|
self.mkIf (key != null) {
|
|
|
|
"${key}" = {
|
|
|
|
inherit action desc;
|
|
|
|
lua = true;
|
|
|
|
silent = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-04-12 21:42:55 +00:00
|
|
|
mkExprBinding = key: action: desc:
|
|
|
|
self.mkIf (key != null) {
|
|
|
|
"${key}" = {
|
|
|
|
inherit action desc;
|
|
|
|
lua = true;
|
|
|
|
silent = true;
|
|
|
|
expr = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-04-11 12:38:08 +00:00
|
|
|
mkBinding = key: action: desc:
|
|
|
|
self.mkIf (key != null) {
|
|
|
|
"${key}" = {
|
|
|
|
inherit action desc;
|
|
|
|
silent = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-04-12 18:13:30 +00:00
|
|
|
mkMappingOption = description: default:
|
|
|
|
self.mkOption {
|
|
|
|
type = self.types.nullOr self.types.str;
|
|
|
|
inherit default description;
|
|
|
|
};
|
|
|
|
|
2023-02-06 18:57:35 +00:00
|
|
|
# For forward compatibility.
|
|
|
|
literalExpression = super.literalExpression or super.literalExample;
|
|
|
|
literalDocBook = super.literalDocBook or super.literalExample;
|
|
|
|
})
|