nixeovim/default.nix

37 lines
848 B
Nix
Raw Normal View History

2024-04-26 02:08:23 +03:00
{ config ? { }
, pkgs ? import <nixpkgs> { }
, nix2lua ? import <nix2lua>
}:
let nix2lua' = nix2lua; in
2024-04-26 02:08:23 +03:00
let
inherit (pkgs.lib) evalModules filter concatMapStringsSep showWarnings;
nix2lua = nix2lua'.lib;
lib = import ./lib {
inherit (pkgs) lib;
inherit nix2lua;
};
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
{
2024-05-05 17:55:47 +03:00
inherit (module.config) build;
2024-04-26 02:08:23 +03:00
inherit (module) config options;
inherit pkgs;
}