Oxidized bindings for the Nix package manager!!
Find a file
hercules-ci[bot] 5055f171ed
Merge pull request #17 from nixops4/flake-update
`flake.lock`: Update
2025-12-06 20:12:55 +00:00
.vscode dev: Recommend against clangd vscode extension 2025-10-04 02:31:17 +02:00
dev dev/flake.lock: Update 2025-12-06 15:10:49 -05:00
doc/hacking maint: Move to /rust/* to / 2025-10-26 23:29:13 +01:00
nix-bindings-bindgen-raw maint: Move to /rust/* to / 2025-10-26 23:29:13 +01:00
nix-bindings-expr Format, and keep formatted 2025-12-05 16:55:09 -05:00
nix-bindings-fetchers maint: Move to /rust/* to / 2025-10-26 23:29:13 +01:00
nix-bindings-flake Format, and keep formatted 2025-12-05 16:55:09 -05:00
nix-bindings-store Clone for Derivation 2025-12-06 13:42:24 -05:00
nix-bindings-util fix(nix-bindings-rust): fix aarch64 abi support 2025-12-06 13:58:00 -05:00
.envrc feat: Rust skeleton 2025-09-30 17:57:50 +02:00
.gitignore feat: Rust skeleton 2025-09-30 17:57:50 +02:00
bindgen-gcc.sh maint: Move to /rust/* to / 2025-10-26 23:29:13 +01:00
Cargo.lock maint: Move to /rust/* to / 2025-10-26 23:29:13 +01:00
Cargo.toml maint: Move to /rust/* to / 2025-10-26 23:29:13 +01:00
flake.lock flake.lock: Update 2025-12-06 15:10:49 -05:00
flake.nix Work around dead code analysis bug 2025-12-06 15:10:49 -05:00
LICENSE License as LGPL-2.1 2025-10-04 02:31:16 +02:00
nci.nix Format, and keep formatted 2025-12-05 16:55:09 -05:00
README.md feat: Expose module for setting up the build and test environment. 2025-10-27 14:52:48 +01:00

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.