2024-04-26 02:08:23 +03:00
|
|
|
{ config ? { }
|
|
|
|
, pkgs ? import <nixpkgs> { }
|
|
|
|
, nix2lua ? import <nix2lua>
|
|
|
|
}:
|
|
|
|
|
2024-04-30 00:46:43 +03:00
|
|
|
|
|
|
|
let nix2lua' = nix2lua; in
|
2024-04-26 02:08:23 +03:00
|
|
|
let
|
|
|
|
inherit (pkgs.lib) evalModules filter concatMapStringsSep showWarnings;
|
|
|
|
|
2024-04-30 00:46:43 +03:00
|
|
|
nix2lua = nix2lua'.lib;
|
|
|
|
|
|
|
|
lib = import ./lib {
|
|
|
|
inherit (pkgs) lib;
|
|
|
|
inherit nix2lua;
|
|
|
|
};
|
2024-04-28 00:39:50 +03:00
|
|
|
|
2024-04-26 02:08:23 +03:00
|
|
|
allModules = import ./module-list.nix { inherit pkgs; };
|
|
|
|
|
|
|
|
rawModule = evalModules {
|
|
|
|
modules = [ config ] ++ allModules;
|
2024-04-30 00:48:10 +03:00
|
|
|
specialArgs = { inherit pkgs lib; };
|
2024-04-26 02:08:23 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|