/solflake

Reproducible Solana program builds with Nix Flakes

Primary LanguageNixMIT LicenseMIT

solflake

An attempt at Nix-ifying the Solana toolchain for reproducible builds with pinned dependencies.

This repository is a work in progress and contributions are welcome!

Install

Assuming Nix is already installed, this project can be used directly from the command line to load the Solana platform in a shell.

$ nix develop github:nasadorian/solflake

It can also be referenced in a flake.nix file for a Solana project.

{
  description = "A very basic Solana flake";
  inputs = {
    solflake.url = "github:nasadorian/solflake";
  };
  outputs = { self, solflake }: {
    ...
  };
}

Usage

Once the flake has been loaded into the developer environment, a Solana program project can be compiled using cargo directly.

cargo build --release --target sbf-solana-solana

Please note that the cargo-build-sbf tool and cargo build-sbf will not work, as they depend on rustup, which this flake intentionally elides.

Supported Versions

Version is currently pinned to Solana v1.17.6 and platform-tools v1.39 while development is underway. The longer term aim is to mirror all available upstream releases so the flake can be used with a version tag.

Supported Systems

System support mirrors that of solana and platform-tools.

  • Linux x86_64
  • Darwin x86_64 and aarch64 aka Apple Silicon
  • Windows not yet supported, please contribute