showAttrPath
lib.attrsets.showAttrPath
Docs pulled from | This Revision | 10 minutes ago
Turns a list of strings into a human-readable description of those
strings represented as an attribute path. The result of this function is
not intended to be machine-readable.
Create a new attribute set with value
set at the nested attribute location specified in attrPath
.
Inputs
path
-
Attribute path to render to a string
Type
showAttrPath :: [String] -> String
Examples
lib.attrsets.showAttrPath
usage example
showAttrPath [ "foo" "10" "bar" ]
=> "foo.\"10\".bar"
showAttrPath []
=> "<root attribute path>"
Noogle detected
Implementation
The following is the current implementation of this function.
showAttrPath =
path:
if path == [ ] then "<root attribute path>" else concatMapStringsSep "." escapeNixIdentifier path;