lib.neovimConfiguration: deprecated extraModules and configuration

This commit is contained in:
Gerg-L 2024-09-21 17:13:24 -04:00
parent 99ace503ad
commit 084846cc2c
No known key found for this signature in database
3 changed files with 21 additions and 23 deletions

View file

@ -1,18 +0,0 @@
{
inputs,
lib,
}: let
modulesWithInputs = import ../modules inputs;
in
{
modules ? [],
pkgs,
check ? true,
extraSpecialArgs ? {},
extraModules ? [],
...
}:
modulesWithInputs {
inherit pkgs lib check extraSpecialArgs extraModules;
configuration.imports = modules;
}

View file

@ -11,5 +11,5 @@
languages = import ./languages.nix {inherit lib;};
lists = import ./lists.nix {inherit lib;};
lua = import ./lua.nix {inherit lib;};
neovimConfiguration = import ./configuration.nix {inherit inputs lib;};
neovimConfiguration = import ../modules {inherit inputs lib;};
}

View file

@ -1,10 +1,14 @@
inputs: {
configuration,
pkgs,
{
inputs,
lib,
}: {
pkgs,
check ? true,
extraSpecialArgs ? {},
modules ? [],
# deprecated
extraModules ? [],
configuration ? {},
}: let
inherit (pkgs) vimPlugins;
inherit (lib.strings) isString toString;
@ -19,7 +23,19 @@ inputs: {
# optionally with any additional modules passed by the user
module = lib.evalModules {
specialArgs = extraSpecialArgs // {modulesPath = toString ./.;};
modules = concatLists [[configuration] nvimModules extraModules];
modules = concatLists [
nvimModules
modules
(lib.optional (configuration != {}) (lib.warn ''
nvf: passing 'configuration' to lib.neovimConfiguration is deprecated.
''
configuration))
(lib.optionals (extraModules != []) (lib.warn ''
nvf: passing 'extraModules' to lib.neovimConfiguration is deprecated, use 'modules' instead.
''
extraModules))
];
};
# alias to the internal configuration