mkEnvironment
import { mkEnvironment } from "https://garn.io/ts/v0.0.16/environment.ts";A low-level helper to create new Environments from NixExpressions.
§
§Parameters
§
setup?: NixExpression optional
[src]- An optional shell script to set up the environment. This script will be run for
every
Checkbefore the snippet given toEnvironment.checkis executed.
// Create a new environment where the current working directory is available under `src`:
const myEnv = mkEnvironment(
nixRaw`pkgs.mkShell {}`,
nixStrLit`
cp -r ${nixRaw`./.`} src
cd src
`,
);
Any Checks created from this environment will first copy the source files
into the Check's sandbox and then run the check script snippet:
const check = myEnv.check("! grep -ir TODO .");