1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-11-25 19:51:06 +01:00
nixvim/wrappers/darwin.nix
Matt Sturgeon 947cb0aaed 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.
2025-11-24 11:10:47 +00:00

34 lines
483 B
Nix

self:
{
config,
lib,
...
}:
let
inherit (lib)
mkIf
;
inherit (lib.modules)
importApply
;
cfg = config.programs.nixvim;
evalArgs = {
extraSpecialArgs = {
darwinConfig = config;
};
modules = [
./modules/darwin.nix
];
};
in
{
_file = ./darwin.nix;
imports = [ (importApply ./_shared.nix { inherit self evalArgs; }) ];
config = mkIf cfg.enable {
environment.systemPackages = [
cfg.build.package
];
};
}