escapeNixString
lib.strings.escapeNixString
Docs pulled from | This Revision | 4 days ago
Turn a string s into a Nix expression representing that string
Inputs
- s
- 1. Function argument
Type
escapeNixString :: string -> string
Examples
lib.strings.escapeNixString usage example
escapeNixString "hello\${}\n"
=> "\"hello\\\${}\\n\""
Noogle detected
Implementation
The following is the current implementation of this function.
escapeNixString = s: escape [ "$" ] (toJSON s);