mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
27 lines
678 B
Nix
27 lines
678 B
Nix
default_pkgs: modules: {
|
|
pkgs ? default_pkgs,
|
|
module,
|
|
}: let
|
|
inherit (pkgs) lib;
|
|
|
|
wrap = {wrapRc = true;};
|
|
|
|
shared = import ./_shared.nix modules {
|
|
inherit pkgs lib;
|
|
config = {};
|
|
};
|
|
|
|
eval = lib.evalModules {
|
|
modules = [module wrap] ++ shared.topLevelModules;
|
|
};
|
|
|
|
handleAssertions = config: let
|
|
failedAssertions = map (x: x.message) (lib.filter (x: !x.assertion) config.assertions);
|
|
in
|
|
if failedAssertions != []
|
|
then throw "\nFailed assertions:\n${builtins.concatStringsSep "\n" (map (x: "- ${x}") failedAssertions)}"
|
|
else lib.showWarnings config.warnings config;
|
|
|
|
config = handleAssertions eval.config;
|
|
in
|
|
config.finalPackage
|