mononix/Mononix/Index.md

1.6 KiB

Tools for running builds using Nix in a monorepo.

Goal: Using one coherent build tool, I can develop multiple projects with common dependencies.

Requirements:

  • select the toolchains and versions thereof for the project
  • configure cross-compilation
  • allow multiple languages
  • co-exist with language ecosystems. For example, rust-analyzer needs cargo in order to understand Cargo.toml. However, it should be easier to fully build the project with Nix
  • every module is compiled into a derivation that downstream modules can import. Each module derivation is cached separately so that Nix only rebuilds the changed module.
  • Nix can generate a closure for an executable, even a cross-compiled one, to copy to the remote system

Languages and Bindings

Languages:

  • C
  • Rust
  • Typescript
  • Javascript

Bindings:

  • C -> Rust
  • Rust -> Typescript
  • Rust -> Javascript

Backends

Linux x86 Linux ARM WASM AVR ESP32
C yes yes yes
Rust yes yes yes yes yes
Typescript yes
Javascript yes

Build targets

  • build
  • run
  • tests
  • code coverage profiling
  • linting
  • performance testing

Each of these is a separate Nix command that builds or runs the desired result.