ITADN
Lillecarl/nanopynix
Lillecarl/nanopynix · 文件
文件最后提交记录最后更新时间
README.md

nanopynix

Documentation codecov

nanobind-based Python bindings for Nix.

The high-level API runs Nix inside an isolated worker subprocess and talks to it over gRPC:

async with (
    nanopynix.rpc.Session(settings=NixSettings(max_jobs=4)) as session,
    session.store() as store,
    session.eval(store) as evaluator,
):
    store_dir = await store.store_dir()
    root = await evaluator.string('{ name = "hello"; }')
    name = await root.attr("name").as_string()

print(store_dir, name)

The whole program, with its imports, is docs/examples/quickstart_example.py, which the test suite runs.

Open multiple Session instances to run differently configured Nix instances in parallel.

Documentation


This project is made possible by

Dynamist