Tests(inventoryStore): add tests for intersecting nix/json lists

This commit is contained in:
Johannes Kirschbauer
2025-05-28 15:39:52 +02:00
parent 07a574cbb0
commit 976c4d52cb
4 changed files with 124 additions and 2 deletions

View File

@@ -0,0 +1 @@
{}

View File

@@ -0,0 +1,32 @@
{ clanLib, lib, ... }:
let
eval = lib.evalModules {
modules = [
{
# Trying to write into the default
options.empty = lib.mkOption {
type = lib.types.listOf lib.types.str;
};
options.predefined = lib.mkOption {
type = lib.types.listOf lib.types.str;
};
}
{
empty = [ ];
predefined = [
"a"
"b"
];
}
# Merge the "inventory.json"
(builtins.fromJSON (builtins.readFile ./lists.json))
];
};
in
{
clanInternals.inventoryClass.inventory = eval.config;
clanInternals.inventoryClass.introspection = clanLib.introspection.getPrios {
options = eval.options;
};
}