From 7ac8b70ebdac1e017bb6029b488b295b75ecd16c Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Wed, 4 Dec 2024 17:41:41 +0100 Subject: [PATCH] clanInternals.inventory: expose used priorities --- lib/build-clan/interface.nix | 1 + lib/build-clan/module.nix | 1 + lib/inventory/build-inventory/interface.nix | 13 ++++++++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/build-clan/interface.nix b/lib/build-clan/interface.nix index baf1a45fb..89f0ad0da 100644 --- a/lib/build-clan/interface.nix +++ b/lib/build-clan/interface.nix @@ -101,6 +101,7 @@ in # Those options are interfaced by the CLI # We don't specify the type here, for better performance. inventory = lib.mkOption { type = lib.types.raw; }; + inventoryValuesPrios = lib.mkOption { type = lib.types.raw; }; # all inventory module schemas moduleSchemas = lib.mkOption { type = lib.types.raw; }; inventoryFile = lib.mkOption { type = lib.types.raw; }; diff --git a/lib/build-clan/module.nix b/lib/build-clan/module.nix index efd1cfaf5..e3f3cb0f8 100644 --- a/lib/build-clan/module.nix +++ b/lib/build-clan/module.nix @@ -183,6 +183,7 @@ in inherit serviceConfigs; inherit (clan-core) clanModules; inherit inventoryFile; + inventoryValuesPrios = (clan-core.lib.values.getPrios { options = inventory.options; }); inventory = config.inventory; meta = config.inventory.meta; diff --git a/lib/inventory/build-inventory/interface.nix b/lib/inventory/build-inventory/interface.nix index 3e152f424..ea3e45422 100644 --- a/lib/inventory/build-inventory/interface.nix +++ b/lib/inventory/build-inventory/interface.nix @@ -1,4 +1,9 @@ -{ lib, config, ... }: +{ + lib, + config, + options, + ... +}: let types = lib.types; @@ -92,6 +97,12 @@ in ./assertions.nix ]; options = { + options = lib.mkOption { + internal = true; + visible = false; + type = types.raw; + default = options; + }; modules = lib.mkOption { type = types.attrsOf types.path; default = { };