mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-11-08 22:45:30 +00:00
modules: adapt entrypoint to fixed-point lib and cleanup
This reduces the copies of nixpkgs's lib passed to the modules. Need to reference `self.lib` for custom functions in modules, which imo is much clearer. For modules outside of nvf, use the nvf input's lib output.
This commit is contained in:
parent
91323800c2
commit
65c4e4aafd
1 changed files with 10 additions and 7 deletions
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
self,
|
||||
inputs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
pkgs,
|
||||
extraSpecialArgs ? {},
|
||||
|
|
@ -10,17 +10,20 @@
|
|||
extraModules ? [],
|
||||
configuration ? {},
|
||||
}: let
|
||||
inherit (pkgs) lib;
|
||||
inherit (lib.modules) evalModules;
|
||||
inherit (lib.strings) toString;
|
||||
inherit (lib.lists) concatLists;
|
||||
inherit (lib.trivial) warn;
|
||||
inherit (lib.lists) concatLists optional optionals;
|
||||
|
||||
# import modules.nix with `check`, `pkgs` and `lib` as arguments
|
||||
# import modules.nix with `check` and `pkgs` as arguments
|
||||
# check can be disabled while calling this file is called
|
||||
# to avoid checking in all modules
|
||||
nvimModules = import ./modules.nix {inherit pkgs lib;};
|
||||
nvimModules = import ./modules.nix {inherit pkgs;};
|
||||
|
||||
# evaluate the extended library with the modules
|
||||
# optionally with any additional modules passed by the user
|
||||
module = lib.evalModules {
|
||||
module = evalModules {
|
||||
specialArgs =
|
||||
extraSpecialArgs
|
||||
// {
|
||||
|
|
@ -30,12 +33,12 @@
|
|||
modules = concatLists [
|
||||
nvimModules
|
||||
modules
|
||||
(lib.optional (configuration != {}) (lib.warn ''
|
||||
(optional (configuration != {}) (warn ''
|
||||
nvf: passing 'configuration' to lib.neovimConfiguration is deprecated.
|
||||
''
|
||||
configuration))
|
||||
|
||||
(lib.optionals (extraModules != []) (lib.warn ''
|
||||
(optionals (extraModules != []) (warn ''
|
||||
nvf: passing 'extraModules' to lib.neovimConfiguration is deprecated, use 'modules' instead.
|
||||
''
|
||||
extraModules))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue