Tests(inventoryStore): add tests for intersecting nix/json lists
This commit is contained in:
1
pkgs/clan-cli/clan_lib/persist/fixtures/lists.json
Normal file
1
pkgs/clan-cli/clan_lib/persist/fixtures/lists.json
Normal file
@@ -0,0 +1 @@
|
||||
{}
|
||||
32
pkgs/clan-cli/clan_lib/persist/fixtures/lists.nix
Normal file
32
pkgs/clan-cli/clan_lib/persist/fixtures/lists.nix
Normal 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;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user