mkEnvironment
import { mkEnvironment } from "https://garn.io/ts/v0.0.16/environment.ts";
A low-level helper to create new Environment
s from NixExpression
s.
§
§Parameters
§
setup?: NixExpression optional
[src]- An optional shell script to set up the environment. This script will be run for
every
Check
before the snippet given toEnvironment.check
is 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 Check
s 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 .");