Where the problem is
I want to make it pure string but I don’t know how and either found it in the documents.
Where the problem is
I want to make it pure string but I don’t know how and either found it in the documents.
To escape ${
in multi-line strings you can use ''${
. Heres the documentation on this: Data Types - Nix Reference Manual.
It’s described here in the definition of strings:
https://nixos.org/manual/nix/stable/language/values.html#type-string
There’s a separate page for interpolation, and arguably it should be in that section, or at least referenced there, but this particular form is specific to indented strings.
Since
${
and''
have special meaning in indented strings, you need a way to quote them.$
can be escaped by prefixing it with''
(that is, two single quotes), i.e.,''$
.''
can be escaped by prefixing it with'
, i.e.,'''
.$
removes any special meaning from the following$
. Linefeed, carriage-return and tab characters can be written as''\n
,''\r
,''\t
, and''\
escapes any other character.