1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-11-27 12:41:03 +01:00

wrappers: use importApply to preserve module location

The `import module args` pattern is useful for applying inputs from
outside of the module system, however it discards module location
metadata that is usually associated with file-path modules.

`lib.modules.importApply` solves that problem by wrapping the applied
module using `lib.modules.setDefaultModuleLocation`.

This means documentation, warnings, and errors will show the correct
location.
This commit is contained in:
Matt Sturgeon 2025-11-24 10:41:21 +00:00
parent 453fe40893
commit 947cb0aaed
2 changed files with 10 additions and 4 deletions

View file

@ -8,6 +8,9 @@ let
inherit (lib)
mkIf
;
inherit (lib.modules)
importApply
;
cfg = config.programs.nixvim;
evalArgs = {
extraSpecialArgs = {
@ -21,7 +24,7 @@ in
{
_file = ./darwin.nix;
imports = [ (import ./_shared.nix { inherit self evalArgs; }) ];
imports = [ (importApply ./_shared.nix { inherit self evalArgs; }) ];
config = mkIf cfg.enable {
environment.systemPackages = [