mirror of
https://github.com/nix-community/nixvim.git
synced 2026-08-24 10:14:03 -05:00
wrappers: pass in existing lib.nixvim
Extracting `specialArgs.lib.nixvim` from the final `programs.nixvim` configuration is neat, but recursive. In non-lazy scenarios, it can end up infinitely recursive. We could extract `specialArgs.lib.nixvim` from another nixvim configuration, such as one of the earlier `extendModules` evaluations, however it is better to avoid evaluating multiple configurations unnecessarily. Instead, revert back to getting `lib.nixvim` from the same configuration we get `extendModules` from.
This commit is contained in:
@@ -4,7 +4,10 @@
|
||||
...
|
||||
}:
|
||||
let
|
||||
importWrapper = lib.flip lib.modules.importApply { inherit extendModules; };
|
||||
importWrapper = lib.flip lib.modules.importApply {
|
||||
inherit extendModules;
|
||||
nixvimLib = lib.nixvim;
|
||||
};
|
||||
in
|
||||
{
|
||||
options.build = {
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
{
|
||||
# A `lib.nixvim` instance
|
||||
nixvimLib,
|
||||
# Function used to evaluate the `programs.nixvim` configuration
|
||||
extendModules,
|
||||
# Option path where extraFiles should go
|
||||
@@ -86,7 +88,7 @@ in
|
||||
# NOTE: It is important that we use the flake-locked Nixpkgs lib,
|
||||
# so that we can safely use recently added lib features.
|
||||
# TODO: Consider deprecating `_module.args.nixvimLib`?
|
||||
lib.nixvim = lib.mkDefault finalConfiguration._module.specialArgs.lib.nixvim;
|
||||
lib.nixvim = lib.mkDefault nixvimLib;
|
||||
_module.args.nixvimLib = lib.mkDefault (lib.extend libOverlay);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
nixvimLib,
|
||||
extendModules,
|
||||
}:
|
||||
{
|
||||
@@ -20,6 +21,7 @@ in
|
||||
|
||||
imports = [
|
||||
(importApply ./_shared.nix {
|
||||
inherit nixvimLib;
|
||||
inherit
|
||||
(extendModules {
|
||||
specialArgs.darwinConfig = config;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
nixvimLib,
|
||||
extendModules,
|
||||
}:
|
||||
{
|
||||
@@ -17,6 +18,7 @@ in
|
||||
|
||||
imports = [
|
||||
(import ./_shared.nix {
|
||||
inherit nixvimLib;
|
||||
inherit
|
||||
(extendModules {
|
||||
specialArgs.hmConfig = config;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
nixvimLib,
|
||||
extendModules,
|
||||
}:
|
||||
{
|
||||
@@ -17,6 +18,7 @@ in
|
||||
|
||||
imports = [
|
||||
(import ./_shared.nix {
|
||||
inherit nixvimLib;
|
||||
inherit
|
||||
(extendModules {
|
||||
specialArgs.nixosConfig = config;
|
||||
|
||||
Reference in New Issue
Block a user