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 =
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,