mirror of
https://github.com/nix-community/nixvim.git
synced 2025-11-25 19:51:06 +01:00
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.
34 lines
483 B
Nix
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
|
|
];
|
|
};
|
|
}
|