mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 16:39:00 +02:00
helpers/mkDefaultOpt: make 'global' parameter optional
This commit is contained in:
parent
f1c8f9a8d2
commit
6e39178dd3
1 changed files with 8 additions and 2 deletions
|
@ -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,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue