Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

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.

function nixRaw(s: TemplateStringsArray, ...interpolations: Array<NixExpression>): NixExpression;
function nixRaw(s: string): NixExpression;
function nixRaw(s: TemplateStringsArray | string, ...interpolations: Array<NixExpression>): NixExpression;
§
nixRaw(s: TemplateStringsArray, ...interpolations: Array<NixExpression>): NixExpression
[src]

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.

§Parameters

§
s: TemplateStringsArray
[src]
§
...interpolations: Array<NixExpression> optional
[src]
§
nixRaw(s: string): NixExpression
[src]

§Parameters

§
s: string
[src]
§
nixRaw(s: TemplateStringsArray | string, ...interpolations: Array<NixExpression>): NixExpression
[src]

§Parameters

§
s: TemplateStringsArray | string
[src]
§
...interpolations: Array<NixExpression> optional
[src]