Oxidized bindings for the Nix package manager!!
Flake lock file updates:
• Updated input 'flake-parts':
'github:hercules-ci/flake-parts/4524271976b625a4a605beefd893f270620fd751?narHash=sha256-%2BuWLQZccFHwqpGqr2Yt5VsW/PbeJVTn9Dk6SHWhNRPw%3D' (2025-09-01)
→ 'github:hercules-ci/flake-parts/2cccadc7357c0ba201788ae99c4dfa90728ef5e0?narHash=sha256-LlLt2Jo/gMNYAwOgdRQBrsRoOz7BPRkzvNaI/fzXi2Q%3D' (2025-11-21)
• Updated input 'flake-parts/nixpkgs-lib':
'github:nix-community/nixpkgs.lib/a73b9c743612e4244d865a2fdee11865283c04e6?narHash=sha256-x2rJ%2BOvzq0sCMpgfgGaaqgBSwY%2BLST%2BWbZ6TytnT9Rk%3D' (2025-08-10)
→ 'github:nix-community/nixpkgs.lib/719359f4562934ae99f5443f20aa06c2ffff91fc?narHash=sha256-b0yj6kfvO8ApcSE%2BQmA6mUfu8IYG6/uU28OFn4PaC8M%3D' (2025-10-29)
• Updated input 'nix':
'github:NixOS/nix/5f42e5ebb797433e3db3cfbc81f9cc3139903636?narHash=sha256-esRP6gaYG8d3gLkfr306HBgWYe2jEfHIJq6A1W/pdYw%3D' (2025-12-05)
→ 'github:NixOS/nix/525755dadc153c68e5ada8d287ab19af26383fff?narHash=sha256-oMSKV0NFQpfwYQ4wcIIDuH%2B0AwCQl%2BbYRgPznx38i8k%3D' (2025-12-06)
• Updated input 'nix-cargo-integration':
'github:yusdacra/nix-cargo-integration/529758e12981b62d6977a7bc61c86e19c3e11594?narHash=sha256-v3MasfpOtYUV4MzG5JGRS4JIo3lccjBzH9qZi7zQzSM%3D' (2025-09-01)
→ 'github:yusdacra/nix-cargo-integration/0feff946314851edc88b9c783ad7d2dccd49abcc?narHash=sha256-S5k0HAxjq2sbf5BC5DOly66joE08HfiyEJD8v2U3yLc%3D' (2025-12-06)
• Updated input 'nix-cargo-integration/crane':
'github:ipetkov/crane/5b03654ce046b5167e7b0bccbd8244cb56c16f0e?narHash=sha256-/mumx8AQ5xFuCJqxCIOFCHTVlxHkMT21idpbgbm/TIE%3D' (2024-09-26)
→ 'github:ipetkov/crane/95d528a5f54eaba0d12102249ce42f4d01f4e364?narHash=sha256-NU5WaEdfwF6i8faJ2Yh%2BjcK9vVFrofLcwlD/mP65JrI%3D' (2025-09-25)
• Updated input 'nix-cargo-integration/dream2nix':
'github:nix-community/dream2nix/fbec3263cb4895ac86ee9506cdc4e6919a1a2214?narHash=sha256-nrDovydywSKRbWim9Ynmgj8SBm8LK3DI2WuhIqzOHYI%3D' (2025-08-12)
→ 'github:nix-community/dream2nix/ee20942e4524d3458a91108716c847a2d4299d2e?narHash=sha256-4OlkDA0yJyqt5iTX9NqtHNghvkWNzYqmtX7FxDmEXt4%3D' (2025-11-24)
• Updated input 'nix-cargo-integration/mk-naked-shell':
'github:yusdacra/mk-naked-shell/7612f828dd6f22b7fb332cc69440e839d7ffe6bd?narHash=sha256-3XlJrwlR0nBiREnuogoa5i1b4%2Bw/XPe0z8bbrJASw0g%3D' (2023-04-12)
→ 'github:90-008/mk-naked-shell/7612f828dd6f22b7fb332cc69440e839d7ffe6bd?narHash=sha256-3XlJrwlR0nBiREnuogoa5i1b4%2Bw/XPe0z8bbrJASw0g%3D' (2023-04-12)
• Updated input 'nix-cargo-integration/parts':
'github:hercules-ci/flake-parts/af66ad14b28a127c5c0f3bbb298218fc63528a18?narHash=sha256-pHYj8gUBapuUzKV/kN/tR3Zvqc7o6gdFB9XKXIp1SQ8%3D' (2025-08-06)
→ 'github:hercules-ci/flake-parts/2cccadc7357c0ba201788ae99c4dfa90728ef5e0?narHash=sha256-LlLt2Jo/gMNYAwOgdRQBrsRoOz7BPRkzvNaI/fzXi2Q%3D' (2025-11-21)
• Updated input 'nix-cargo-integration/rust-overlay':
'github:oxalica/rust-overlay/b29e5365120f344fe7161f14fc9e272fcc41ee56?narHash=sha256-z/Iy4qvcMqzhA2IAAg71Sw4BrMwbBHvCS90ZoPLsnIk%3D' (2025-09-01)
→ 'github:oxalica/rust-overlay/086fd19a68e80fcc8a298e9df4674982e4c498a6?narHash=sha256-FIJtt3Zil89/hLy9i7f0R2xXcJDPc3CeqiiCLfsFV0Y%3D' (2025-12-06)
• Updated input 'nix-cargo-integration/treefmt':
'github:numtide/treefmt-nix/1aabc6c05ccbcbf4a635fb7a90400e44282f61c4?narHash=sha256-F1oFfV51AE259I85av%2BMAia221XwMHCOtZCMcZLK2Jk%3D' (2025-08-31)
→ 'github:numtide/treefmt-nix/5b4ee75aeefd1e2d5a1cc43cf6ba65eba75e83e4?narHash=sha256-AlEObg0syDl%2BSpi4LsZIBrjw%2BsnSVU4T8MOeuZJUJjM%3D' (2025-11-12)
• Updated input 'nixpkgs':
'github:NixOS/nixpkgs/d7600c775f877cd87b4f5a831c28aa94137377aa?narHash=sha256-tlOn88coG5fzdyqz6R93SQL5Gpq%2Bm/DsWpekNFhqPQk%3D' (2025-08-30)
→ 'github:NixOS/nixpkgs/f61125a668a320878494449750330ca58b78c557?narHash=sha256-BmPWzogsG2GsXZtlT%2BMTcAWeDK5hkbGRZTeZNW42fwA%3D' (2025-12-05)
|
||
|---|---|---|
| .vscode | ||
| dev | ||
| doc/hacking | ||
| nix-bindings-bindgen-raw | ||
| nix-bindings-expr | ||
| nix-bindings-fetchers | ||
| nix-bindings-flake | ||
| nix-bindings-store | ||
| nix-bindings-util | ||
| .envrc | ||
| .gitignore | ||
| bindgen-gcc.sh | ||
| Cargo.lock | ||
| Cargo.toml | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE | ||
| nci.nix | ||
| README.md | ||
nix_bindings_* crates
Use the Nix C API from Rust.
Build with nix-cargo-integration
The development environment and building with Nix are taken care of by nix-cargo-integration (options).
The dependency on Nix is taken care of with the nix-bindings-rust flake-parts module.
Example usage:
{
outputs =
inputs@{ self, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; }
{
imports = [
inputs.nix-cargo-integration.flakeModule
inputs.nix-bindings-rust.modules.flake.default
];
perSystem = { config, pkgs, ... }: {
# optional:
nix-bindings-rust.nixPackage = pkgs.nix;
nci.projects."myproject" = {
depsDrvConfig = {
imports = [ config.nix-bindings-rust.nciBuildConfig ];
};
};
};
};
}
Hacking
The following will open a shell with dependencies, and install pre-commit for automatic formatting.
$ nix develop
VSCode
rust-analyzer
If the rust-analyzer extension fails, make sure the devShell was loaded into VSCode via Nix Env Selector or direnv.