mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-26 10:48:35 +02:00
22 lines
583 B
Nix
22 lines
583 B
Nix
default_pkgs: modules: {
|
|
pkgs ? default_pkgs,
|
|
module,
|
|
}: let
|
|
inherit (pkgs) lib;
|
|
|
|
wrap = {wrapRc = true;};
|
|
|
|
eval = lib.evalModules {
|
|
modules = (modules pkgs) ++ [module wrap];
|
|
};
|
|
|
|
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
|