From 6e39178dd3d8ab956f99d0b718d2dccef5b5eeb1 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 8 Jan 2024 14:36:25 +0100 Subject: [PATCH] helpers/mkDefaultOpt: make 'global' parameter optional --- lib/helpers.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/helpers.nix b/lib/helpers.nix index 56ad77db..9c49fda6 100644 --- a/lib/helpers.nix +++ b/lib/helpers.nix @@ -334,7 +334,13 @@ with lib; rec { globals = mapAttrs' (optName: opt: { - name = globalPrefix + opt.global; + name = let + optGlobal = + if opt.global == null + then optName + else opt.global; + in + globalPrefix + optGlobal; value = cfg.${optName}; }) options; @@ -386,7 +392,7 @@ with lib; rec { mkDefaultOpt = { type, - global, + global ? null, description ? null, example ? null, default ? null,