Nix flake providing development environments and build tasks for the Rain Protocol ecosystem.
Rainix is shared infrastructure consumed by other Rain repos — the actual project code lives in downstream consumers.
Add Rainix as a flake input:
{
inputs.rainix.url = "github:rainlanguage/rainix";
}Requires Nix with flakes enabled.
nix develop # default shell (Solidity + Rust + Node + subgraph tools)
nix develop .#sol-shell # slim Solidity-only shell — no rust, node, chromium, subgraph
nix develop .#tauri-shell # Tauri desktop app developmentThe default shell auto-sources .env if present and runs
npm ci --ignore-scripts if package.json exists. sol-shell skips both.
All tasks are Nix packages run via nix run. From a consuming repo:
nix run ..#rainix-sol-test— forge testnix run ..#rainix-sol-static— slither + forge fmt checknix run ..#rainix-sol-legal— REUSE/DCL-1.0 license compliancenix run ..#rainix-sol-artifacts— deploy to testnet
nix run ..#rainix-rs-test— cargo testnix run ..#rainix-rs-static— cargo fmt + clippynix run ..#rainix-rs-artifacts— cargo build --release
Downstream flakes can compose their own tasks and shells using:
pkgs— nixpkgs with all overlays appliedrust-toolchain— pinned Rust toolchainrust-build-inputs,sol-build-inputs,node-build-inputs— dependency listsmkTask— create Nix derivations wrapping shell scripts with dependencies on PATH
.github/workflows/publish-soldeer.yaml is a workflow_call reusable that
pushes a Solidity package to soldeer.xyz on every v* tag. Consumer repos need
a five-line wrapper:
name: Publish to Soldeer
on:
push:
tags: ["v*"]
jobs:
publish:
uses: rainlanguage/rainix/.github/workflows/publish-soldeer.yaml@main
secrets: inheritThe package name defaults to the repo name with . replaced by -
(rain.solmem → rain-solmem), since soldeer rejects . in package names.
Override via the package_name input only if the registry name diverges.
SOLDEER_API_TOKEN must be set in the consumer repo (or org) secrets, and the
project must already exist on soldeer.xyz — the registry rejects pushes to
nonexistent projects.
.github/workflows/rainix-sol-static.yaml runs rainix-sol-static (slither) on
Linux. Wrapper in the consumer repo:
name: rainix-sol-static
on: [push]
jobs:
static:
uses: rainlanguage/rainix/.github/workflows/rainix-sol-static.yaml@mainRuns forge soldeer install automatically when a soldeer.lock is present.
.github/workflows/rainix-sol-legal.yaml runs rainix-sol-legal (reuse lint)
on Linux. Same wrapper shape as the static one:
name: rainix-sol-legal
on: [push]
jobs:
legal:
uses: rainlanguage/rainix/.github/workflows/rainix-sol-legal.yaml@main.github/workflows/rainix-sol-test.yaml runs rainix-sol-test (forge test)
on Linux. Wrapper:
name: rainix-sol-test
on: [push]
jobs:
test:
uses: rainlanguage/rainix/.github/workflows/rainix-sol-test.yaml@main
secrets: inheritsecrets: inherit is required because the reusable wires the standard fork RPC
env vars (ARBITRUM_RPC_URL, BASE_RPC_URL, BASE_SEPOLIA_RPC_URL,
FLARE_RPC_URL, POLYGON_RPC_URL, CI_DEPLOY_SEPOLIA_RPC_URL) plus
ETHERSCAN_API_KEY and DEPLOYMENT_KEY from the consumer org's secrets/vars.
Repos that do no fork tests can ignore — empty values are harmless.
.github/workflows/rainix-sol.yaml fans out static, legal, and test in parallel
— each on its own runner. Single wrapper for sol-only repos that want all three:
name: rainix
on: [push]
jobs:
rainix:
uses: rainlanguage/rainix/.github/workflows/rainix-sol.yaml@main
secrets: inheritConsumers needing only one of the three should call the individual reusable directly rather than this composite.
.github/workflows/rainix-build-pointers.yaml regenerates
./script/BuildPointers.sol artifacts, runs forge fmt, then asserts
git diff --exit-code — failing the PR if a maintainer changed
pointer-affecting source without committing the updated
src/generated/*.pointers.sol files.
name: build-pointers
on: [push]
jobs:
build-pointers:
uses: rainlanguage/rainix/.github/workflows/rainix-build-pointers.yaml@mainAlways runs through rainix's sol-shell (slim), regardless of the consumer's
default devShell.
.github/workflows/rainix-rs-static.yaml runs rainix-rs-static (cargo fmt
check + clippy with -D clippy::all) on Linux. Wrapper:
name: rainix-rs-static
on: [push]
jobs:
rs-static:
uses: rainlanguage/rainix/.github/workflows/rainix-rs-static.yaml@mainAlways runs through rainix's rust-shell (rust toolchain only — no
chromium/sol/node), regardless of the consumer's default devShell.
.github/workflows/rainix-rs-test.yaml runs cargo test on Linux and macOS.
Wrapper:
name: rainix-rs-test
on: [push]
jobs:
rs-test:
uses: rainlanguage/rainix/.github/workflows/rainix-rs-test.yaml@mainSame shape as rs-static — runs through rust-shell. Consumers whose rust crate
compiles standalone (no live forge artifacts at compile time) can drop their
bespoke rs-test matrix in favour of this.
.github/workflows/rainix-rs-wasm.yaml cross-compiles the workspace to
wasm32-unknown-unknown (release, library targets only). For consumers that
ship rust crates downstream as WASM (e.g. via wasm-bindgen for JS/TS), this
catches WASM-incompatible dependencies before they reach the JS build. Wrapper:
name: rainix-rs-wasm
on: [push]
jobs:
rs-wasm:
uses: rainlanguage/rainix/.github/workflows/rainix-rs-wasm.yaml@mainrust-shell's toolchain already includes the wasm32-unknown-unknown target,
so no extra setup is required.
.github/workflows/rainix-rs.yaml fans out static, test, and wasm in parallel —
each on its own runner. Single wrapper for rust-shipping repos that want all
three:
name: rainix-rs
on: [push]
jobs:
rainix-rs:
uses: rainlanguage/rainix/.github/workflows/rainix-rs.yaml@mainConsumers needing only one of the three should call the individual reusable directly rather than this composite.
- Rust: 1.94.0
- Solidity: solc 0.8.25
- Foundry: via foundry.nix
- Graph CLI: 0.69.2
- Goldsky CLI: 13.3.4
DecentraLicense 1.0 — enforced via reuse lint.