Oxidized bindings for the Nix package manager!!
Find a file
2025-12-05 16:34:56 -05:00
.vscode dev: Recommend against clangd vscode extension 2025-10-04 02:31:17 +02:00
dev maint: Fix warnings 2025-10-27 14:52:48 +01: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 maint: Move to /rust/* to / 2025-10-26 23:29:13 +01:00
nix-bindings-fetchers maint: Move to /rust/* to / 2025-10-26 23:29:13 +01:00
nix-bindings-flake maint: Move to /rust/* to / 2025-10-26 23:29:13 +01:00
nix-bindings-store Update to latest Nix master 2025-12-05 16:34:56 -05:00
nix-bindings-util maint: Move to /rust/* to / 2025-10-26 23:29:13 +01: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 Update to latest Nix master 2025-12-05 16:34:56 -05:00
flake.nix doc: Render declarations without the deferredModule indirection 2025-10-27 14:59:29 +01:00
LICENSE License as LGPL-2.1 2025-10-04 02:31:16 +02:00
nci.nix feat: Expose module for setting up the build and test environment. 2025-10-27 14:52:48 +01: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.