Eval nix code from python
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.clang-format
.editorconfig
.gitignore
.travis.yml
LICENSE.md
README.md
default.nix
meson.build
shell.nix
tests.py

README.md

Python3 bindings for nix

Build Status

Build from source

$ meson . build
$ ninja -C build

or:

$ nix-build

Usage

$ cd build/src
$ python3
>>> import nix
>>> nix.eval('(1 + a)', vars=dict(a=2))
3
>>> nix.eval("builtins.currentSystem")
'x86_64-linux'
>>> nix.eval("with import <nixpkgs> {}; lib.nixpkgsVersion")
'18.03.git.15c484a965a'