callFlake
import { callFlake } from "https://garn.io/ts/v0.0.19/mod.ts";
Gets apps, checks, dev-shells, and packages from an existing flake file within your current project.
§
callFlake(flakeDir: string): ImportedFlake
[src]§Parameters
§
flakeDir: string
[src]The relative path to the directory containing a flake.nix
Absolute flakeDir
s and paths outside of the garn project are not
supported. Consider using importFlake
instead if you want to import an
absolute flake path or one from a URL.
This can be used to migrate an existing flake project to use garn.
Example:
const myFlake = callFlake("./path/to/dir");
const myProject = getGarnProjectSomehow()
.add(() => ({
format: myFlake.getApp("format"),
env: myFlake.getDevShell("default"),
bundle: myFlake.getPackage("bundle"),
allChecks: myFlake.allChecks,
}));