Reproducible builds, dev envs and deployments.

Overview

🐂 Toros

An implementation of Nix in Rust.

CI/CD Documentation Coverage Version License

  • Syntax support:
  • Interpreter support:
    • Int
    • Binding (aliasing)
    • Let-in (flat bindings without interpolation like a = 123;)
    • Function (without destructuring and ellipsis)
    • Function Application
    • Deferred Values (Laziness)
  • Built-ins:
    • Addition (+)
  • Store interface:
    • Rust trait
  • Store implementations:
    • On Disk
    • S3-like
    • IPFS
  • Good error messages (location, message, call stack)
    • In CLI options/commands
    • Lexing/parsing errors
    • Evaluation errors
Comments
  • design/motivation doc

    design/motivation doc

    There have already been a few attempts at rewriting parts of, or all of Nix in Rust. While it is usually heavily discourage to completely rewrite a well established tool in a new language, I think there are a lot of idioms in Rust that map far more nicely to the concepts inherit in Nix than they do in C++, additionally, the current implementation leaves a lot to be desired, and refactoring the existing C++ would be difficult enough to feasibly justify such a rewrite after all.

    That said, we also have tvix being worked on, which, at least according to the blog post, has been designed with a few desirable goals in mind, i.e. better performance, native IFD, etc. So it might be worthwhile to clarify what exactly are the goals of this project compared to others? Perhaps it is too early to care at this point, and that's a valid answer as well, but it'd be nice to know, from a potential contributors standpoint what the actual goals are.

    A few questions off the top of my head, is this meant to be a serious replacement, just a toy project, an educational exercise, or useful as a core for other tooling (like an LSP)? If it is meant to be a full replacement someday, what are the key differentiating factors that would make this project worthwhile compared to Nix or Tvix? There are a lot of legacy design decisions in Nix that could really be improved if we establish these goals early enough, so I think, if this is meant to be a serious competitor in the long run, the sooner we clarify those goals, the better.

    opened by nrdxp 0
  • regex builtins

    regex builtins

    Hi, I've written https://github.com/zseri/nix-builtin-utils (when it hits a stable state I'd like to move it to the nix-community org, but it's not there yet...), which provides a C interface for the regex API which the original Nix implementation uses for builtin.match and builtin.split (look at the test suite for usage examples). These proved to be difficult when trying to transpile Nix to Javascript, and also when trying to implement it in Rust (otherwise I could've just compiled a rust impl to WASM, and get it done that way...) because most regex engines differ, so that they can cause subtle breakage...

    opened by zseri 0
  • Update Cargo.toml

    Update Cargo.toml

    Mentioning "0" would mean cargo would pick the latest dependency which is versioned "0.*" which would include versions incompatible with the one that this crate was written with and may break your create.

    opened by Dylan-DPC 0
  • add macro: build_math_fn, implement math: add sub mul

    add macro: build_math_fn, implement math: add sub mul

    low hanging fruit ...

    move build_math_fn to separate file?

    lets rename built-in + to built-in add? (etc) - is used for subtraction and negation ! cannot be used in filenames

    rename built_in to builtin? (like in nix)

    
            match (&*lhs, &*rhs) {
                (Value::String { parts: lhs_value }, Value::String { parts: rhs_value }) => {
                    let mut new_value = LinkedList::<StringPart>::new();
                    for val in lhs_value {
                        new_value.push_back(*val);
                        // error[E0507]: cannot move out of `*val` which is behind a shared reference
                        // move occurs because `*val` has type `StringPart`, which does not implement the `Copy` trait
                    }
                    for val in rhs_value {
                        new_value.push_back(*val);
                    }
                    Ok(Rc::new(Value::String { parts: new_value }))
                }
    
    error[E0507]: cannot move out of `*val` which is behind a shared reference
       --> src/interpreter/runtime.rs:273:41
        |
    273 |                     new_value.push_back(*val);
        |                                         ^^^^ move occurs because `*val` has type `StringPart`, which does not implement the `Copy` trait
    

    implement copy trait in nixel?

    opened by milahu 0
  • add shell.nix

    add shell.nix

    in my case: nix develop will download 2GB of dependencies = killjoy nix-shell will download 10MB of dependencies

    can we add a shell.nix file? (and call that from flake.nix)

    { pkgs ? import <nixpkgs> {} }:
    pkgs.mkShell {
      buildInputs = with pkgs; [
        cargo
        cargo-tarpaulin
        clippy
        entr
        jq
        linuxPackages_latest.perf
        reuse
        rustc
      ];
    }
    
    opened by milahu 1
  • Store interface

    Store interface

    Regarding store abstractions, it would be nice to know / extrapolate what exactly is necessary for the interpreter side to deal with stores. Thus, I want to sort-of collect stuff here which I think may be important (it if gets too off-topic, I'll move stuff to https://github.com/RIIR-Nix/rfcs instead) Also, the operations of the store can be split into three categories: Reading, Writing, Building. I think it might be a good idea to model this via multiple (maybe async) traits, especially because some stores don't support Writing (read-only) or Building (S3), e.g.

    trait StoreRead { /* query store prefix, has hash path?, download hash path from store ... */ }
    trait StoreWrite: StoreRead { /* upload hash path to store ... */ }
    trait StoreBuild: StoreWrite { /* build derivation ... */ }
    

    (derivation building is a bit weird, because the derivation function takes an attrset containing a pretty wild mix, and doesn't explicitly separate what ends up in the environment, what doesn't, might contain magic modifiers (__contentAddressed, __structuredAttrs,...), etc. (see also, somewhat generic abstraction of that))

    Another question would be how to deal with store paths, store hashes and potentially content addressing, and the three different "types"/kinds of store paths/hashes:

    • input addressed recursively based on input addressed only (this is usually the only type in classic non-CA Nix stores)
    • input addressed with mixed (some CA-outputs as inputs) or no inputs)
    • content addressed (these correspond roughly to the content-addressed derivation resolver in Nix; and leakage of placeholders in Nix when using content-addressed derivations sort-of proofs that this is a bit more difficult than expected)

    Also, store paths have some sort of common format, which is useful when e.g. rewriting store paths in dumps or such (pretty much implemented here (although that store path format deviates a bit from the nix format, which is the reason why store_ref_scanner::StoreSpec exists))

    Another thing to abstract are "store dumps" (e.g. deserialized NARs), e.g. something like https://github.com/YZITE/yzix/blob/cdd10d1249d6b6d8a79ed04d6acb01f92c932117/crates/yzix-core/src/dump.rs#L13-L17

    pub enum Dump {
        Regular { executable: bool, contents: Vec<u8> },
        SymLink { target: Utf8PathBuf },
        Directory(std::collections::BTreeMap<crate::BaseName, Dump>),
    }
    
    opened by zseri 2
Owner
Kevin Amado
Generalist, Creator, Leader, Security first developer
Kevin Amado
GTK application for browsing and installing fonts from Google's font archive

Font Finder This project is a from-scratch implementation of TypeCatcher in Rust. It is a GTK3 application for browsing through and installing fonts f

Michael Murphy 252 Dec 26, 2022
Linux Kernel Manager and Activity Monitor 🐧💻

Linux Kernel Manager and Activity Monitor ?? ?? The kernel is the part of the operating system that facilitates interactions between hardware and soft

Orhun Parmaksız 1.7k Jan 5, 2023
A project for automatically generating and maintaining Debian repositories from a TOML spec.

Debian Repository Builder A simple utility for constructing and maintaining Debian repositories. Configuration of a repo is based on the directory hie

Pop!_OS 52 Feb 7, 2022
Utility that takes logs from anywhere and sends them to Telegram.

logram Utility that takes logs from anywhere and sends them to Telegram. Supports log collection from files, journald and docker containers. More abou

Max Eliseev 85 Dec 22, 2022
A safe and ergonomic alternative to rm

rip (Rm ImProved) rip is a command-line deletion tool focused on safety, ergonomics, and performance. It favors a simple interface, and does not imple

Kevin Liu 781 Jan 7, 2023
A simple, fast and user-friendly alternative to 'find'

fd [中文] [한국어] fd is a program to find entries in your filesytem. It is a simple, fast and user-friendly alternative to find. While it does not aim to

David Peter 25.8k Dec 30, 2022
Untrusted IPC with maximum performance and minimum latency. On Rust, on Linux.

Untrusted IPC with maximum performance and minimum latency. On Rust, on Linux. When is this Rust crate useful? Performance or latency is crucial, and

null 72 Jan 3, 2023
CLI utility to move (or rename) your files to a new location and redirect all of its symbolic links, to the new path

Move Links CLI utility to move (or rename) your files to a new location and redirect all of its symbolic links, to the new path (or name). Usage execu

Ben Mefteh 18 May 22, 2022
A tool to simplify reprovisioning a fresh OS. Installs packages and manages dotfiles.

[[TOC]] Comtrya This is better, yes? Warning This tool is ridiculously early in its development. I'm building out features as I migrate my dotfiles ov

David McKay 2 Dec 29, 2022
A tool to simplify reprovisioning a fresh OS. Installs packages and manages dotfiles.

Comtrya This is better, yes? Warning This tool is ridiculously early in its development. I'm building out features as I migrate my dotfiles over. Thos

Comtrya 272 Jan 7, 2023
Parallel finance a decentralized lending protocol built on top of the Polkadot ecosystem. Our unique approach will allow users to earn "double interests" from staking and lending their tokens simultaneously.

Parallel Finance A new Cumulus-based Substrate node, ready for hacking ?? Getting Started Follow these steps to get started with the Cumulus Template

parallel-finance 100 Dec 17, 2022
idf-env tool helps set up and manage ESP-IDF installations

idf-env Tool for maintaining ESP-IDF environment. Quick start Install serial drivers for ESP boards on Windows. Execute following command in PowerShel

Espressif Systems 19 Dec 4, 2022
A system handler to get information and interact with processes written in Rust

A system handler to get information and interact with processes written in Rust

Guillaume Gomez 1.1k Jan 3, 2023
OCI Runtime, Image and Distribution Spec in Rust

oci-spec-rs Open Container Initiative (OCI) Specifications for Rust This library provides a convenient way to interact with the specifications defined

Containers 119 Dec 29, 2022
It is a backup tool that creates backups and stores them on an object storage

Hold My Backup It is a backup tool that creates backups and stores them on an object storage. By default it uses minio but you can use AWS: S3 as well

Taylan Dogan 13 Feb 17, 2022
desktop automation, screen capture, input listen/simulation, asar compress, color picker for nodejs and electron based on rust

desktop automation, screen capture, input listen/simulation, asar compress, color picker for nodejs and electron based on rust. 基于 Rust / WASM 提供截图、取色、键鼠事件监听模拟、压缩解压、图像处理、获取已安装应用等跨平台功能的现代异步 Nodejs 模块,占用空间小, 安装便捷, 使用简单, 高性能, 资源占用极小, 可取代 iohook 和 robotjs

null 48 Dec 15, 2022
`haproxy_autconfd` is a daemon that automatically assembles a HAProxy config and restarts HAProxy if the config changes

haproxy_autconfd Welcome to haproxy_autconfd ?? haproxy_autconfd is a daemon that automatically assembles a HAProxy config and restarts HAProxy if the

null 0 Nov 9, 2021
A fast and minimalistic image viewer forked from the now discontinued emulsion.

Alloy Image viewer based on (now-discontinued) Emulsion. Alloy targets Windows, Mac, and Linux (with more targets to come!). A note for Linux users: W

Ardaku Systems 9 Dec 1, 2022
Independent verification of binary packages - reproducible builds

rebuilderd(1) Independent verification system of binary packages. Accessing a rebuilderd instance in your browser Scripting access to a rebuilderd ins

null 311 Dec 30, 2022
Authenticate a tarball through a signed tag in a git repository (with reproducible builds)

auth-tarball-from-git Authenticate a tarball through a signed tag in a git repository (with reproducible builds). The signed git tag contains a hash o

null 14 Aug 16, 2022