nixRaw
import { nixRaw } from "https://garn.io/ts/v0.0.16/nix.ts";A template literal function to construct NixExpressions from raw strings.
Example:
const myNixExpr = nixRaw`
let
x = ${someNixExpr};
y = ${otherNixExpr};
in
x y
`;
It explicitly does not allow interpolating strings since it is not clear what the correct behavior should be. Instead:
If the string you want to interpolate is a Nix expression, wrap the string
in nixRaw before interpolating, or consider using a NixExpression type
instead of string.
If the string you want to interpolate is meant to turn into a string in Nix,
wrap the string in nixStrLit before interpolating.
A template literal function to construct NixExpressions from raw strings.
Example:
const myNixExpr = nixRaw`
let
x = ${someNixExpr};
y = ${otherNixExpr};
in
x y
`;
It explicitly does not allow interpolating strings since it is not clear what the correct behavior should be. Instead:
If the string you want to interpolate is a Nix expression, wrap the string
in nixRaw before interpolating, or consider using a NixExpression type
instead of string.
If the string you want to interpolate is meant to turn into a string in Nix,
wrap the string in nixStrLit before interpolating.