Tvix - A Rust implementation of Nix

Overview

Tvix

Tvix is a new implementation of the Nix language and package manager. See the announcement post for information about the background of this project.

Tvix is developed by TVL in our monorepo, the depot, at //tvix. Code reviews take place on Gerrit, bugs are filed in our issue tracker.

For more information about Tvix, feel free to reach out. We are interested in people who would like to help us review designs, brainstorm and describe requirements that we may not yet have considered.

Most of the discussion around development happens on our IRC channel, which you can join in several ways documented on tvl.fyi, or on our mailing list.

Contributions to Tvix follow the TVL review flow and contribution guidelines.

WARNING: Tvix is not ready for use in production. None of our current APIs should be considered stable in any way.

WARNING: Any other instances of this project or repository are josh-mirrors. We do not accept code contributions or issues outside of the tooling and communication methods outlined above.

Components

This folder contains the following components:

  • //tvix/eval - an implementation of the Nix programming language
  • //tvix/nix-compat - library functions for compatibility with C++ Nix
  • //tvix/cli - preliminary REPL & CLI implementation for Tvix
  • //tvix/serde - Rust library for using the Nix language for app configuration
  • //tvix/store - implementation of a file store for Tvix

Some additional folders with auxiliary things exist and can be explored at your leisure.

Building the CLI

The CLI can also be built with standard Rust tooling (i.e. cargo build), as long as you are in a shell with the right dependencies.

  • If you cloned the full monorepo, it can be provided by mg shell //tvix:shell.
  • If you cloned the tvix workspace only (git clone https://code.tvl.fyi/depot.git:workspace=views/tvix.git), nix-shell provides it.

If you're in the TVL monorepo, you can also run mg build //tvix/cli (or mg build from inside that folder) for a more incremental build.

Please follow the depot-wide instructions on how to get mg and use the depot tooling.

Compatibility

Important note: We only use and test Nix builds of our software against Nix 2.3. There are a variety of bugs and subtle problems in newer Nix versions which we do not have the bandwidth to address, builds in newer Nix versions may or may not work.

Rust projects, crate2nix

Some parts of Tvix are written in Rust. To simplify the dependency management on the Nix side of these builds, we use crate2nix in a single Rust workspace in //tvix to maintain the Nix build configuration.

When making changes to Cargo dependency configuration in any of the Rust projects under //tvix, be sure to run mg run //tvix:crate2nixGenerate -- in //tvix itself and commit the changes to the generated Cargo.nix file. This only applies to the full TVL checkout.

License structure

All code implemented for Tvix is licensed under the GPL-3.0, with the exception of the protocol buffer definitions used for communication between services which are available under a more permissive license (MIT).

The idea behind this structure is that any direct usage of our code (e.g. linking to it, embedding the evaluator, etc.) will fall under the terms of the GPL3, but users are free to implement their own components speaking these protocols under the terms of the MIT license.

You might also like...
Rust implementation of Waku v2 (f.k.a. Whisper)

waku-rs Waku is a p2p messaging protocol tailored for the web3, with origins in Ethereum's Whisper. This Rust implementation is taking reference from

The second Rust implementation on GitHub of third-party REST API client for Bilibili.

Bilibili REST API The second Rust implementation on GitHub of third-party REST API client for Bilibili. Designed to be lightweight and efficient. It's

Rust-only ext4 implementation without unsafe code.

Rust-Ext4 Rust-only ext4 implementation without unsafe code. Supporting features no_std Direct/Indirect Block Addressing (RO) Extent Tree Addressing (

Rust implementation of DVB-GSE

dvb-gse dvg-se is a Rust implementation of the DVB GSE (Generic Stream Encapsulation) protocol and related protocols. It is mainly intended to be used

Rust implementation of Surging Object DiGraph (SODG)

This Rust library implements a Surging Object DiGraph (SODG) for reo virtual machine for EO programs. Here is how you can create a di-graph: use sodg:

Rust library provides a standalone implementation of the ROS (Robot Operating System) core

ROS-core implementation in Rust This Rust library provides a standalone implementation of the ROS (Robot Operating System) core. It allows you to run

A Rust implementation of HyperLogLog trying to be parsimonious with memory.

🧮 HyperLogLog-rs This is a Rust library that provides an implementation of the HyperLogLog (HLL) algorithm, trying to be parsimonious with memory. Wh

A Rust implementation of V8's ValueSerializer and ValueDeserializer

v8_valueserializer This module implements the V8 ValueSerializer and ValueDeserializer API in Rust. It can serialize and deserialize any value that ca

Experimental Quantum Computer Simulator + Quantum Chess Implementation
Experimental Quantum Computer Simulator + Quantum Chess Implementation

Quantum Chess A somewhat hacky implementation of this paper (made in a week over a holiday). It's not heavily tested and probably has some bugs still

Owner
The Virus Lounge
The Virus Lounge
lints and suggestions for the nix programming language

statix Lints and suggestions for the Nix programming language. statix highlights antipatterns in Nix code. statix --fix can fix several such occurrenc

Akshay 311 Dec 25, 2022
Rust implementation of Andrej Karpathy's micrograd for purposes of learning both ML and Rust.

micrograd_rs Rust implementation of Andrej Karpathy's micrograd for purposes of learning both ML and Rust. Main takeaways Basically the same takeaways

null 3 Oct 28, 2022
Ray Tracing: The Next Week implementation in Rust

rttnw Ray Tracing: The Next Week implementation in Rust How to run Install Rust: Link here. Run project git clone https://github.com/luliic2/rttnw cd

null 20 Apr 26, 2022
Rust implementation of µKanren, a featherweight relational programming language.

µKanren-rs This is a Rust implementation of µKanren, a featherweight relational programming language. See the original Scheme implementation here for

Eric Zhang 99 Dec 8, 2022
An implementation of Olm and Megolm in pure Rust.

A Rust implementation of Olm and Megolm vodozemac is a Rust implementation of libolm, a cryptographic library used for end-to-end encryption in Matrix

matrix.org 66 Dec 26, 2022
Pure Rust Implementation of secp256k1.

SECP256K1 implementation in pure Rust Cargo Documentation SECP256K1 implementation with no_std support. Currently we have implementation for: Convert

Parity Technologies 141 Dec 21, 2022
A Rust implementation of generic prefix tree (trie) map with wildcard capture support

prefix_tree_map A Rust implementation of generic prefix tree (trie) map with wildcard capture support. Design Trie is a good data structure for storin

EAimTY 3 Dec 6, 2022
fast rust implementation of online nonnegative matrix factorization as laid out in the paper "detect and track latent factors with online nonnegative matrix factorization"

ONMF status: early work in progress. still figuring this out. code still somewhat messy. api still in flux. fast rust implementation of online nonnega

null 2 Apr 10, 2020
A modular implementation of timely dataflow in Rust

Timely Dataflow Timely dataflow is a low-latency cyclic dataflow computational model, introduced in the paper Naiad: a timely dataflow system. This pr

Timely Dataflow 2.7k Dec 30, 2022
A fast lean and clean modern constraint programming solver implementation (in rust)

MaxiCP-rs This project aims at implementing a fast, and clean constraint programming solver with a focus on correctness, simplicity, maintainability a

Xavier Gillard 5 Dec 10, 2022