kubenix/tests/submodules/exports.nix

41 lines
626 B
Nix
Raw Normal View History

2022-04-02 12:40:35 -07:00
{
name,
config,
lib,
kubenix,
subm-lib,
...
}:
with lib; let
submodule = {
2022-04-02 12:40:35 -07:00
imports = [kubenix.modules.submodule];
config.submodule = {
name = "subm";
exports = {
inherit id;
};
};
};
2022-04-02 12:40:35 -07:00
in {
imports = with kubenix.modules; [test submodules];
test = {
name = "submodules-exports";
description = "Submodules exports test";
2022-04-02 12:40:35 -07:00
assertions = [
{
message = "should have library exported";
assertion = subm-lib.id 1 == 1;
}
];
};
2022-04-02 12:40:35 -07:00
submodules.imports = [
{
modules = [submodule];
exportAs = "subm-lib";
}
];
}