helpers/mkDefaultOpt: make 'global' parameter optional

This commit is contained in:
Gaetan Lepage 2024-01-08 14:36:25 +01:00 committed by Gaétan Lepage
parent f1c8f9a8d2
commit 6e39178dd3

View file

@ -334,7 +334,13 @@ with lib; rec {
globals = globals =
mapAttrs' mapAttrs'
(optName: opt: { (optName: opt: {
name = globalPrefix + opt.global; name = let
optGlobal =
if opt.global == null
then optName
else opt.global;
in
globalPrefix + optGlobal;
value = cfg.${optName}; value = cfg.${optName};
}) })
options; options;
@ -386,7 +392,7 @@ with lib; rec {
mkDefaultOpt = { mkDefaultOpt = {
type, type,
global, global ? null,
description ? null, description ? null,
example ? null, example ? null,
default ? null, default ? null,