From d4865d10e43dc411671ee34f65da7b946639c3d1 Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Tue, 8 Oct 2024 12:11:46 +0200 Subject: [PATCH] Inventory/interface: add enable flag for service instances --- lib/inventory/build-inventory/interface.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/inventory/build-inventory/interface.nix b/lib/inventory/build-inventory/interface.nix index 7ce60c89a..56c05fb3b 100644 --- a/lib/inventory/build-inventory/interface.nix +++ b/lib/inventory/build-inventory/interface.nix @@ -184,6 +184,19 @@ in # instance name { name, ... }: { + options.enabled = lib.mkOption { + type = lib.types.bool; + default = true; + description = '' + Enable or disable the complete service. + + If the service is disabled, it will not be added to any machine. + + !!! Note + This flag is primarily used to temporarily disable a service. + I.e. A 'backup service' without any 'server' might be incomplete and would cause failure if enabled. + ''; + }; options.meta = metaOptionsWith name; options.extraModules = extraModulesOption; options.config = moduleConfig // {