31 lines
762 B
Nix
31 lines
762 B
Nix
{ config ? { }
|
|
, pkgs ? import <nixpkgs> { }
|
|
, nix2lua ? import <nix2lua>
|
|
}:
|
|
|
|
|
|
let
|
|
inherit (pkgs.lib) evalModules filter concatMapStringsSep showWarnings;
|
|
|
|
allModules = import ./module-list.nix { inherit pkgs; };
|
|
|
|
rawModule = evalModules {
|
|
modules = [ config ] ++ allModules;
|
|
specialArgs = {
|
|
inherit pkgs;
|
|
nix2lua = nix2lua.lib;
|
|
};
|
|
};
|
|
|
|
failedAssertions = map (x: x.message) (filter (x: !x.assertion) rawModule.config.assertions);
|
|
|
|
module =
|
|
if failedAssertions != [ ]
|
|
then throw "\nFailed assertions:\n${concatMapStringsSep "\n" (x: "- ${x}") failedAssertions}"
|
|
else showWarnings rawModule.config.warnings rawModule;
|
|
in
|
|
{
|
|
inherit (module.config.build) neovim;
|
|
inherit (module) config options;
|
|
inherit pkgs;
|
|
}
|