No description
Find a file
Vincent Ambo 0ce396bdab feat(nix/lazy-deps): Add function to generate lazy binary dispatcher
There is a reoccuring problem in readTree-type repositories that use
nix-shell, where evaluation of the full set of dependencies that
should be made available to users takes a noticeable amount of time,
slowing down operations when `direnv` is involved.

In depot, we have so far fixed this by maintaining a manual `//bin`
directory which contains a set of symlinks to a central dispatch
script that can dispatch to various tools in depot lazily.

This script can instead be generated ad-hoc by Nix (pretty fast if we
can make assumptions like `git` and `nix-build` existing on user's
machines already) and added to $PATH.

The function introduced in this commit implements the logic for that.
The structure of the script is based on the existing
`//bin/__dispatch`.

This does not yet switch depot's envrc to use this new method of
installing dependencies lazily.

Change-Id: I92efcd9bb6aa51aa2709ad910a464e9dac97ee89
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5512
Tested-by: BuildkiteCI
Reviewed-by: ezemtsov <eugene.zemtsov@gmail.com>
2022-05-02 23:34:55 +00:00
.nixery feat(ops/modules): Add module for running Nixery 2021-08-12 14:55:59 +00:00
bin feat(bin): add entry for niv 2022-04-15 12:14:28 +00:00
corp style: format entire depot with nixpkgs-fmt 2022-01-31 16:11:53 +00:00
docs docs(CONTRIBUTING): Mention new subtree commit type 2021-11-30 22:42:34 +00:00
fun chore(paroxysm): Bump dependencies 2022-04-17 13:16:34 +00:00
lisp feat(nix/buildLisp): add ecl 2021-08-24 22:00:15 +00:00
net chore(net/crimp): Bump all dependencies via cargo update 2022-02-20 15:46:57 +00:00
nix feat(nix/lazy-deps): Add function to generate lazy binary dispatcher 2022-05-02 23:34:55 +00:00
ops fix(ops/besadii): Fix output formatting for non-CL builds 2022-04-26 09:25:03 +00:00
third_party chore(3p/sources): Bump channels & overlays 2022-04-26 19:16:38 +00:00
tools feat(magrathea): add flag passthru for arguments to nix-build 2022-05-01 20:27:30 +00:00
tvix style(rust): Format all Rust code with rustfmt 2022-02-08 12:06:39 +00:00
users feat(sterni/emacs): install meson-mode 2022-05-02 21:14:54 +00:00
views feat(tvl-kit): add magrathea to TVL kit 2022-02-14 10:47:17 +00:00
web chore(web/converse): Bump dependencies 2022-04-17 13:16:34 +00:00
.envrc chore: Unfuck NIX_PATH in the .envrc 2020-06-15 16:50:44 +00:00
.git-blame-ignore-revs fix: add cl/4397 (treewide nixpkgs-fmt) to git-blame-ignore-revs 2022-02-07 18:15:09 +00:00
.gitignore chore(gitignore): Ignore garbage/ folder 2019-12-20 20:05:40 +00:00
.hgignore chore(hgignore): ignore .git for hg 2020-06-14 18:23:13 +00:00
.mailmap chore(mailmap): add my name to mailmap 2020-07-18 18:15:05 +00:00
.rgignore chore: Only exclude //third_party/git from ripgrep 2020-05-17 23:58:22 +01:00
buf.yaml feat(buf.yaml): add protobuf linter config 2020-07-17 20:01:29 +00:00
default.nix style: format entire depot with nixpkgs-fmt 2022-01-31 16:11:53 +00:00
LICENSE docs(readTree): Add SPDX license header on readTree 2021-04-12 13:56:44 +00:00
OWNERS feat(depot): Add grfn and sterni to top-level owners 2021-12-10 18:11:16 +03:00
README.md chore(nixery): Housekeeping for depot compatibility 2022-04-20 15:31:16 +00:00
RULES feat(whitby): Let sterni bear the wheel 2021-05-23 19:06:15 +00:00
rustfmt.toml feat(depotfmt): Check & format Rust code with rustfmt 2022-02-08 12:06:39 +00:00

depot

Build status

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 on code.tvl.fyi.

    The repository can be cloned using git from https://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's rules_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/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.
  • //third_party/nix contains our fork of the Nix package manager.

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 modeline
    • nix-util.el provides editing utilities for Nix files
    • term-switcher.el is an ivy-function for switching between vterm buffers
    • tvl.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/tazjin/homepage && //users/tazjin/blog: A Nix-based static site generator which generates the web page and Atom feed for tazj.in
  • //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.