3d238c350b
Previously the construction of globals (a compiler-only concept) and builtins (a (now) user-facing API) was intermingled between multiple different modules, and kind of difficult to understand. The complexity of this had grown in large part due to the implementation of `builtins.import`, which required the notorious "knot-tying" trick using Rc::new_cyclic (see cl/7097) for constructing the set of globals. As part of the new `Evaluation` API users should have the ability to bring their own builtins, and control explicitly whether or not impure builtins are available (regardless of whether they're compiled in or not). To streamline the construction and allow the new API features to work, this commit restructures things by making these changes: 1. The `tvix_eval::builtins` module is now only responsible for exporting sets of builtins. It no longer has any knowledge of whether or not certain sets (e.g. only pure, or pure+impure) are enabled, and it has no control over which builtins are globally available (this is now handled in the compiler). 2. The compiler module is now responsible for both constructing the final attribute set of builtins from the set of builtins supplied by a user, as well as for populating its globals (that is identifiers which are available at the top-level scope). 3. The `Evaluation` API now carries a `builtins` field which is populated with the pure builtins by default, and can be extended by users. 4. The `import` feature has been moved into the compiler, as a special case. In general, builtins no longer have the ability to reference the "fix point" of the globals set. This should not change any functionality, and in fact preserves minor differences between Tvix/Nix that we already had (such as `builtins.builtins` not existing). Change-Id: Icdf5dd50eb81eb9260d89269d6e08b1e67811a2c Reviewed-on: https://cl.tvl.fyi/c/depot/+/7738 Reviewed-by: sterni <sternenseemann@systemli.org> Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de> |
||
---|---|---|
.gcroots | ||
.nixery | ||
corp | ||
docs | ||
fun | ||
lisp | ||
net | ||
nix | ||
ops | ||
third_party | ||
tools | ||
tvix | ||
users | ||
views | ||
web | ||
.envrc | ||
.git-blame-ignore-revs | ||
.gitignore | ||
.hgignore | ||
.mailmap | ||
.rgignore | ||
buf.gen.yaml | ||
buf.yaml | ||
default.nix | ||
LICENSE | ||
OWNERS | ||
README.md | ||
RULES | ||
rustfmt.toml |
depot
This repository is the monorepo for the community around The Virus Lounge, containing our personal tools and infrastructure. Everything in here is built using Nix.
A large portion of the software here is very self-referential, meaning that it exists to sustain the operation of the repository. This is the case because we partially see this as an experiment in tooling for monorepos.
Highlights
Services
-
Source code is available primarily through Sourcegraph on cs.tvl.fyi, where it is searchable and even semantically indexed. A lower-tech view of the repository is also available via cgit-pink on code.tvl.fyi.
The repository can be cloned using
git
fromhttps://cl.tvl.fyi/depot
. -
All code in the depot, with the exception of code that is checked in to individual
//users
folders, needs to be reviewed. We use Gerrit on cl.tvl.fyi for this. -
Issues are tracked via our own issue tracker on b.tvl.fyi. Its source code lives at
//web/panettone/
. -
Smaller todo-list entries which do not warrant a separate issue are listed at todo.tvl.fyi.
-
We use Buildkite for CI. Recent builds are listed on tvl.fyi/builds and pipelines are configured dynamically via
//ops/pipelines
. -
A search service that makes TVL services available via textual shortcuts is available: atward
All services that we host are deployed on NixOS machines that we manage. Their
configuration is tracked in //ops/{modules,machines}
.
Nix
//nix/readTree
contains the Nix code which automatically registers projects in our Nix attribute hierarchy based on their in-tree location//tools/nixery
contains the source code of Nixery, a container registry that can build images ad-hoc from Nix packages//nix/yants
contains Yet Another Nix Type System, which we use for a variety of things throughout the repository//nix/buildGo
implements a Nix library that can build Go software in the style of Bazel'srules_go
. Go programs in this repository are built using this library.//nix/buildLisp
implements a Nix library that can build Common Lisp software. Currently only SBCL is supported. Lisp programs in this repository are built using this library.//web/blog
and//web/atom-feed
: A Nix-based static site generator which generates the web page and Atom feed for tazj.in (//users/tazjin/homepage
) and tvl.fyi (//web/tvl
)//web/bubblegum
contains a CGI-based web framework written in Nix.//nix/nint
: A shebang-compatible interpreter wrapper for Nix.//tvix
contains initial work towards a modular architecture for Nix.
We have a variety of other tools and libraries in the //nix
folder which may
be of interest.
Packages / Libraries
//net/alcoholic_jwt
contains an easy-to-use JWT-validation library for Rust//net/crimp
contains a high-level HTTP client using cURL for Rust//tools/emacs-pkgs
contains various useful Emacs libraries, for example:dottime.el
provides dottime in the Emacs modelinenix-util.el
provides editing utilities for Nix filesterm-switcher.el
is an ivy-function for switching between vterm bufferstvl.el
provides helper functions for interacting with the TVL monorepo
//lisp/klatre
provides a grab-bag utility library for Common Lisp
User packages
Contributors to the repository have user directories under
//users
, which can be used for
personal or experimental code that does not require review.
Some examples:
//users/grfn/xanthous
: A (WIP) TUI RPG, written in Haskell.//users/tazjin/emacs
: tazjin's Emacs & EXWM configuration//users/tazjin/finito
: A persistent finite-state machine library for Rust.
Licensing
Unless otherwise stated in a subdirectory, all code is licensed under the MIT license. See LICENSE for details.
Contributing
If you'd like to contribute to any of the tools in here, please check out the contribution guidelines and our code of conduct.
IRC users can find us in #tvl
on hackint, which is also
reachable via XMPP at #tvl@irc.hackint.org
(sic!).
Hackint also provide a web chat.