Skip to content

Add Nix tooling: flake, devshell, crane checks, CI, stub Cargo workspace - #2

Closed
patextreme wants to merge 17 commits into
mainfrom
nix-tooling
Closed

patextreme wants to merge 17 commits into
mainfrom
nix-tooling

Conversation

@patextreme

Copy link
Copy Markdown
Contributor

Summary

Bootstrap reproducible Nix development environment and check/CI guardrails for the sdk-rust submodule (OpenSpec change: add-nix-tooling).

This is a greenfield submodule: previously there was no flake.nix and no Cargo.toml. This PR establishes the reproducible environment and the check/CI guardrails that all subsequent feature proposals will rely on, plus a stub Cargo workspace the checks operate on.

What's included

  • Flake (flake-parts + devshell + rust-overlay + crane), systems: x86_64-linux, aarch64-darwin.
  • Rust toolchain (nix/rust-toolchain.nix): stable toolchain with rust-src, rust-analyzer, wasm32-unknown-unknown target + a shared craneLib.
  • Devshell (nix/devshells/default.nix, name sdk-rust): rust, C toolchain (stdenv.cc, pkg-config, openssl), cargo-nextest/cargo-deny/cargo-audit, protobuf, and Nix hygiene tools (nixfmt, deadnix, statix).
  • Checks (nix/checks/): lint-nix (deadnix/statix/nixfmt) + crane rust-fmt / rust-clippy (-D warnings) / rust-test (cargo-nextest) / rust-deny / rust-audit (pinned advisory-db), sharing one buildDepsOnly cargoArtifacts derivation.
  • Formatting apps: nix run .#format (cargo fmt + nixfmt) and nix run .#format-nix.
  • deny.toml: cargo-deny policy (advisories / licenses / bans / sources), permissive.
  • Stub Cargo workspace: root Cargo.toml (resolver = "3", edition = "2024", MSRV 1.85.0, workspace lints) + crates/identus-ssi placeholder.
  • CI: .github/workflows/nix-checks.yml — matrix ubuntu-latest/macos-latest, installs Nix via DeterminateSystems, runs nix flake check; all third-party actions pinned to commit SHAs.
  • README: documents the nix develop workflow.

Verification

  • nix develop -c cargo build, cargo test, cargo fmt --check, cargo clippy -- -D warnings all pass.
  • nix flake check green on x86_64-linux; aarch64-darwin outputs (checks/apps/devShells) evaluate cleanly (darwin build runs in CI).
  • nix run .#format / nix run .#format-nix verified.

Notes

  • No Identus SSI functionality is implemented — the stub crate is an empty placeholder landing zone for future proposals.
  • No runtime/API impact.

🤖 Generated with the help of pi

The repository ruleset requires DCO and CodeQL status checks,
but the workflows were missing. This adds both so pushes can
succeed on protected branches.

Signed-off-by: Pat Losoponkul <[email protected]>
@patextreme
patextreme marked this pull request as draft June 30, 2026 10:32
Bootstrap reproducible Nix development environment and check/CI guardrails
for the sdk-rust submodule (OpenSpec change: add-nix-tooling).

- flake.nix (flake-parts + devshell + rust-overlay + crane), systems:
  x86_64-linux, aarch64-darwin
- nix/rust-toolchain.nix: stable toolchain (rust-src, rust-analyzer,
  wasm32-unknown-unknown) + shared craneLib
- nix/devshells/default.nix: sdk-rust devshell (rust, C toolchain,
  cargo-nextest/deny/audit, nix hygiene tools)
- nix/checks: lint-nix + crane rust-fmt/clippy/test/deny/audit sharing
  one buildDepsOnly cargoArtifacts derivation
- nix/apps: format (cargo fmt + nixfmt) and format-nix
- deny.toml: cargo-deny policy (advisories/licenses/bans/sources)
- stub Cargo workspace: root Cargo.toml + crates/identus-ssi placeholder
  (edition 2024, MSRV 1.85.0, resolver 3, workspace lints)
- .github/workflows/nix-checks.yml: matrix (ubuntu/macos) nix flake check
- Remove the broken repo-local .github/workflows/dco.yml (unresolvable
  christophebedard/dco action + typo'd harden-runner SHA). Sibling
  submodules (e.g. neoprism) carry no repo-local DCO workflow; DCO is
  enforced at the org level by the cncf/dco2 status check, which passes
  on signed-off commits.
- README: document nix develop workflow

Signed-off-by: Pat Losoponkul <[email protected]>
- Remove broken .github/workflows/codeql.yml: CodeQL does not support
  Rust (its python analysis is useless here) and the harden-runner SHA
  was a typo. Sibling submodules (e.g. neoprism) use Scorecard, not
  CodeQL. This also clears the yamllint trailing-newline failure.
- markdownlint: ignore .pi/** (agent tooling scaffolding) and
  openspec/** (OpenSpec-managed artifacts use a format that conflicts
  with MD041 first-line-h1).
- README: add `text` language to the workflow diagram fence (MD040).
- AGENTS: add a blank line before a list (MD032).

Signed-off-by: Pat Losoponkul <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant