nixeovim/default.nix

41 lines
1.0 KiB
Nix

{ config ? { }
, pkgs ? import <nixpkgs> { }
, nix2lua ? import <nix2lua>
, specialArgs ? { }
}:
let nix2lua' = nix2lua; in
let
inherit (pkgs.lib) evalModules filter concatMapStringsSep showWarnings;
nix2lua = nix2lua'.lib;
lib = import ./lib {
inherit (pkgs) lib;
inherit nix2lua;
};
allModules = import ./module-list.nix { inherit pkgs; };
modulesPath = ./modules;
rawModule = evalModules {
modules = [ config ] ++ allModules;
specialArgs = { inherit pkgs lib modulesPath; } // specialArgs;
};
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
{
neovim = builtins.trace "Obsolete option `neovim` is used. It was renamed to `build.neovim`" module.config.build.neovim;
inherit (module.config) build;
inherit (module) config options;
inherit pkgs;
}