Introducing Riff, a Nix-based tool for automatically provides external dependencies for Rust projects

Determinate Systems is excited to announce the initial release of Riff, a Nix-based tool for automatically providing external dependencies for Rust projects:

Intro blog post: Introducing Riff.

With Riff, you can can run riff shell to drop into a shell with dependencies that are commonly missing from users’ environments, such as OpenSSL and Protobuf. Similarly, riff run enables you to run shell commands within that same environment, for example riff run cargo build.

Riff works by examining the dependency graph of your Rust project and providing, on a per-crate basis, dependencies that are known to be missing. Riff keeps an internal registry of crate-specific dependencies, but you can also apply dependencies in your Cargo.toml file.

Although Riff uses Nix, it requires no up-front knowledge of Nix. Instead, it wraps the Nix CLI and produces an “internal flake” based on the your project’s Cargo.toml. You can install it now using Nix:

nix profile install github:DeterminateSystems/riff
10 Likes

There is no hint in the introductory post:

Are you considering (secretly) exposing an integration ramp for “Nix for DevOps”-scenarios?

Like:

  • "Just go with riff"
  • “We can integrate it later”

Did you consider using the defaultCrateOverrides in nixpkgs instead of having your own registry?

This looks great! A suggestion on marketing/presentation/messaging, given that this is targetted at users who don’t otherwise use nix.

In the description of what riff does and how it works, steer clear of saying it “installs” dependencies. This could make them nervous about conflicting package managers and all the kinds of things we know nix will help them avoid, but they may not be familiar with. Instead, use language more like that it will “fetch” them into /nix/store and “link” them into the shell environment, without otherwise altering the host system.

For those of us who do use nix, there are some other questions; things we think about that this tool explicitly avoids getting in the way for new users. Stuff like pinning versions of nixpkgs and committing specific dependencies. I guess there will be a flake.lock file created, though it’s not currently explicitly stated. Will there be a way to see the generated flake? I’m thinking for more nix-aware users, it might be a good bootstrapping tool; helping to write the initial flake for external dependencies that can then be customised further.

1 Like
Hosted by Flying Circus.