From 6011ec2bab1acd09e98a8634903d9c41f825baf0 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Tue, 9 Apr 2024 11:18:16 +0300 Subject: [PATCH] lib: get rid of the redundant `let in` block --- lib/stdlib-extended.nix | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/lib/stdlib-extended.nix b/lib/stdlib-extended.nix index 746130e..2e05650 100644 --- a/lib/stdlib-extended.nix +++ b/lib/stdlib-extended.nix @@ -1,18 +1,21 @@ -# Cconvenience function that returns the given Nixpkgs standard library +# Convenience function that returns the given Nixpkgs standard library # extended with our functions using `lib.extend`. -nixpkgsLib: inputs: let - mkNvimLib = import ./.; -in +nixpkgsLib: inputs: +nixpkgsLib.extend (self: super: { # WARNING: New functions should not be added here, but to files # imported by `./default.nix` under their own categories. If your # function does not fit to any of the existing categories, create # a new file and import it in `./default.nix.` - nixpkgsLib.extend (self: super: { - nvim = mkNvimLib { - inherit inputs; - lib = self; - }; - # For forward compatibility. - literalExpression = super.literalExpression or super.literalExample; - }) + # Makes our custom functions available under `lib.nvim` where stdlib-extended.nix is imported + # with the appropriate arguments. For end-users, a `lib` output will be accessible from the flake. + # E.g. for an input called `neovim-flake`, `inputs.neovim-flake.lib.nvim` will return the set + # below. + nvim = import ./. { + inherit inputs; + lib = self; + }; + + # For forward compatibility. + literalExpression = super.literalExpression or super.literalExample; +})