kubenix/tests/submodules/exports.nix

35 lines
620 B
Nix
Raw Normal View History

2023-07-07 22:01:34 -04:00
{ name, config, lib, kubenix, subm-lib, ... }:
2022-04-02 12:40:35 -07:00
with lib; let
submodule = {
2023-07-07 22:01:34 -04:00
imports = [ kubenix.modules.submodule ];
config.submodule = {
name = "subm";
exports = {
inherit id;
};
};
};
2023-07-07 22:01:34 -04: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 = [
{
2023-07-07 22:01:34 -04:00
modules = [ submodule ];
2022-04-02 12:40:35 -07:00
exportAs = "subm-lib";
}
];
}