mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
lib/helpers: mkRaw now behaves like mkRawIfNonNull
This commit is contained in:
parent
e5cc0c093b
commit
8cf2d943d2
2 changed files with 5 additions and 4 deletions
|
@ -83,7 +83,7 @@ Because the options may not have the same case (and may require some pre-process
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
some_opt = cfg.someOpt;
|
some_opt = cfg.someOpt;
|
||||||
some_raw_opt = helpers.ifNonNull' cfg.someRawOpt (mkRaw cfg.someRawOpt);
|
some_raw_opt = helpers.mkRaw cfg.someRawOpt;
|
||||||
some_meta_opt = with cfg.metaOpt; # metaOpt = { foo = ...; someOtherOpt = ...; };
|
some_meta_opt = with cfg.metaOpt; # metaOpt = { foo = ...; someOtherOpt = ...; };
|
||||||
{
|
{
|
||||||
inherit foo;
|
inherit foo;
|
||||||
|
|
|
@ -115,8 +115,6 @@ with lib; rec {
|
||||||
then null
|
then null
|
||||||
else y;
|
else y;
|
||||||
|
|
||||||
mkRawIfNonNull = v: ifNonNull' v (mkRaw v);
|
|
||||||
|
|
||||||
mkCompositeOption = desc: options:
|
mkCompositeOption = desc: options:
|
||||||
mkNullOrOption (types.submodule {inherit options;}) desc;
|
mkNullOrOption (types.submodule {inherit options;}) desc;
|
||||||
|
|
||||||
|
@ -273,7 +271,10 @@ with lib; rec {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
mkRaw = r: {__raw = r;};
|
mkRaw = r:
|
||||||
|
ifNonNull'
|
||||||
|
r
|
||||||
|
{__raw = r;};
|
||||||
|
|
||||||
wrapDo = string: ''
|
wrapDo = string: ''
|
||||||
do
|
do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue