-
Without default values I explicitly pass
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hej @q0w, I think this question was directed at the Nickel team (this is the Topiary repository). I've pinged them for you and transferred the discussion to their repository! |
Beta Was this translation helpful? Give feedback.
-
There aren't default values for functions per se in Nickel. Two options come to mind. First, you can do the Nix thing and take a record as the single argument. In this record, you can have default values:
The second, and the one that I would recommend, is not using a function to generate this data at all, but instead encode it as a recursively defined record with some fields left to be merged in. Fields that should end up in the final configuration can be marked as
Ideally one would accumulate these kinds of release until the very top of the configuration and only then select the |
Beta Was this translation helpful? Give feedback.
There aren't default values for functions per se in Nickel. Two options come to mind. First, you can do the Nix thing and take a record as the single argument. In this record, you can have default values:
The second, and the one that I would recommend, is not using a function to generate this data at all, but instead encode it as a recursively defined record with some fields left to be merged in. Fields that should end up in the final configuration can be marked as
not_exported
to hide them from serialization in simple cases. Sometimes it's more comfortable to have a dedicatedoutput
attribute. For example,