Giter VIP home page Giter VIP logo

ic-nix's Introduction

Build Internet Computer Projects with Nix

ci release

Unofficial build of common binaries used by developers of the Internet Computer blockchain.

  • Directly built from source.
  • Cross-platform (Linux and Mac OS X, both x86_64 and aarch64).
  • Mostly statically linked with no extra runtime dependency other than libc.
  • Weekly release of latest versions at build time.
  • Optionally, a standalone SDK environment for nix-shell.

Usage

Depending on your objective, you can do any the following:

  • To build a project, run nix-build -A <project>
  • To enter a development environment for a project, run nix-shell -A <project>.shell
  • To download the latest pre-built binaries, go to release page.
  • To start canister SDK development with latest build, run nix-shell https://github.com/ninegua/ic-nix/releases/latest/download/dfx-env.tar.gz

All you need is a working nix installation on your computer.

Compile-yourself from source

For those who prefer to compile from source:

nix-shell https://github.com/ninegua/ic-nix/releases/latest/download/dfx-env.tar.gz --arg force true

You can use pre-compiled derivations by setting a binary cache (courtesy of cachix) nix-shell -p cachix --run 'cachix use ninegua'.

VSCode/direnv

Assuming you're developing on ic.

  1. Make sure you have direnv installed.
  2. Clone this repo next to ic.
  3. Under ic/rs: run echo "use nix ../../ic-nix/default.nix -A ic.shell" > .envrc.
  4. In the same directory, run direnv allow .

If using VSCode, you should also install the direnv vscode extension, to make sure that rust-analyzer will be using the same versions of Rust as your shell.

WARNING

Releases are built against the latest main branches of each project at the time. They may not always work. Please understand the risks before proceed.

Supported projects

Supported platforms and nixpkgs:

23.05 23.11 unstable
darwin x86_64
linux x86_64 ✅︎ ✅︎ ✅︎
darwin aarch64 ✅︎

✅︎: builds with no issue
❌: does not build
⍻: builds but binaries have extra dynamic lib dependency to Nix store

Feature:

  • Build native binaries with nix-build with glibc.
  • Dynamic binaries with minimal dependencies: glibc on Linux, system libs on OS X.
  • Build Wasm binaries with nix-build.
  • Develop with nix-shell.
  • Build release binaries on Github.
  • Build and run all tests.

Note that this effort requires no nix support of a project unless it already has.

ic-nix's People

Contributors

ninegua avatar anchpop avatar github-actions[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.