Nix antiquotation

Within Nix strings, the result of any Nix expression which can be coerced to a string can be interpolated into the string with the syntax ${expression} where expression is the Nix expression.


  • Simple string "Path to hello: ${hello}"

  • Indented string

    What if I wanted the path to hello
    down here?
    ${if wantPathHere then ${hello} else ""}