clanServices: add test to ensure nixosModule is imported
This commit is contained in:
@@ -288,6 +288,7 @@ in
|
||||
];
|
||||
};
|
||||
|
||||
machine_imports = import ./machine_imports.nix { inherit lib clanLib; };
|
||||
per_machine_args = import ./per_machine_args.nix { inherit lib callInventoryAdapter; };
|
||||
per_instance_args = import ./per_instance_args.nix { inherit lib callInventoryAdapter; };
|
||||
nested = import ./nested_services { inherit lib clanLib; };
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
{ lib, clanLib }:
|
||||
let
|
||||
clan = clanLib.clan {
|
||||
self = { };
|
||||
directory = ./.;
|
||||
|
||||
machines.jon = { };
|
||||
machines.sara = { };
|
||||
# A module that adds exports perMachine
|
||||
modules.A =
|
||||
{ ... }:
|
||||
{
|
||||
manifest.name = "A";
|
||||
roles.peer.perInstance =
|
||||
{ ... }:
|
||||
{
|
||||
nixosModule = {
|
||||
options.bar = lib.mkOption {
|
||||
default = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
roles.server = { };
|
||||
perMachine =
|
||||
{ ... }:
|
||||
{
|
||||
nixosModule = {
|
||||
options.foo = lib.mkOption {
|
||||
default = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
inventory.instances.A = {
|
||||
module.input = "self";
|
||||
roles.peer.tags.all = { };
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
test_1 = {
|
||||
inherit clan;
|
||||
expr = { inherit (clan.config.clanInternals.machines.x86_64-linux.jon.config) bar foo; };
|
||||
expected = {
|
||||
foo = 1;
|
||||
bar = 1;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user