nix.nixAttrSet
import { nix } from "https://garn.io/ts/v0.0.19/mod.ts";
const { nixAttrSet } = nix;
Turns a javascript object of NixExpression
s into a Nix attribute set.
Filters out undefined values.
Example:
// returns the Nix expression `{ "a" = 1; "b" = 2; }`
nixAttrSet({
a: nixRaw`1`,
b: nixRaw`2`,
c: undefined,
})
§
nixAttrSet(attrSet: Record<string, NixExpression | undefined>): NixExpression
[src]§Parameters
§
attrSet: Record<string, NixExpression | undefined>
[src]