nix-reference
Installation
SKILL.md
String Escaping
When writing Nix strings that contain code for other languages (TypeScript, JavaScript, etc.), remember:
| What you want in output | Nix syntax |
|---|---|
${variable} |
''${variable} |
$${variable} |
$''${variable} |
''${literal} |
'''${literal} |
Rule: Use two single quotes '' before ${} to prevent Nix from interpolating it.
Example - Generating TypeScript with template literals: