nixeovim/default.nix

41 lines
1 KiB
Nix
Raw Permalink Normal View History

2024-04-26 02:08:23 +03:00
{ config ? { }
, pkgs ? import <nixpkgs> { }
, nix2lua ? import <nix2lua>
2024-05-06 16:47:45 +03:00
, specialArgs ? { }
2024-04-26 02:08:23 +03:00
}:
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; };
2024-05-06 16:47:45 +03:00
modulesPath = ./modules;
2024-04-26 02:08:23 +03:00
rawModule = evalModules {
modules = [ config ] ++ allModules;
2024-05-06 16:47:45 +03:00
specialArgs = { inherit pkgs lib modulesPath; } // specialArgs;
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 18:09:02 +03:00
neovim = builtins.trace "Obsolete option `neovim` is used. It was renamed to `build.neovim`" module.config.build.neovim;
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;
}