mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 09:36:20 +09:00
lib.types: add luaInline
Represents inline lua as expected by `lib.generators.toLua`, for embedding raw lua expressions within structurally generated lua.
This commit is contained in:
parent
7436684102
commit
c347d605c9
3 changed files with 19 additions and 0 deletions
|
@ -834,6 +834,15 @@ rec {
|
|||
};
|
||||
};
|
||||
|
||||
# A value produced by `lib.mkLuaInline`
|
||||
luaInline = mkOptionType {
|
||||
name = "luaInline";
|
||||
description = "inline lua";
|
||||
descriptionClass = "noun";
|
||||
check = x: x._type or null == "lua-inline";
|
||||
merge = mergeEqualOption;
|
||||
};
|
||||
|
||||
uniq = unique { message = ""; };
|
||||
|
||||
unique = { message }: type: mkOptionType rec {
|
||||
|
|
|
@ -232,6 +232,13 @@ merging is handled.
|
|||
definitions cannot be merged. The regular expression is processed
|
||||
using `builtins.match`.
|
||||
|
||||
### Specialised types {#sec-option-types-specialised}
|
||||
|
||||
`types.luaInline`
|
||||
|
||||
: A string wrapped using `lib.mkLuaInline`. Allows embedding lua expressions
|
||||
inline within generated lua. Multiple definitions cannot be merged.
|
||||
|
||||
## Submodule types {#sec-option-types-submodule}
|
||||
|
||||
Submodules are detailed in [Submodule](#section-option-types-submodule).
|
||||
|
|
|
@ -1592,6 +1592,9 @@
|
|||
"sec-option-types-string": [
|
||||
"index.html#sec-option-types-string"
|
||||
],
|
||||
"sec-option-types-specialised": [
|
||||
"index.html#sec-option-types-specialised"
|
||||
],
|
||||
"sec-option-types-submodule": [
|
||||
"index.html#sec-option-types-submodule"
|
||||
],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue