From e1146601c117ab398bd85311c8cdfd6ec51a7fa5 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 18 Jan 2022 18:33:05 +0300 Subject: feat(kit): Export TVL kit as a josh workspace This creates a josh workspace called `views/kit` which exports all dependencies needed by external users of the TVL kit. The intention of this is to have a single clonable "virtual repo" which provides everything needed to run a system like TVL, but without the projects that we develop *in* TVL. Right now this is limited to the basic Nix code (readTree, pipeline generation) and things required for Gerrit integration. The workspace maps depot paths into slightly different (simpler) locations inside the exported view, to avoid a nested, mostly empty structure. Note: This is not an "external API" or some such of depot, it is simply a convenience for exporting some of our tooling. Change-Id: Ied24aaef117fc2e0c188ec742ae7cd993a5babd3 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4991 Tested-by: BuildkiteCI Reviewed-by: sterni --- views/.skip-subtree | 2 ++ views/README.md | 6 ++++++ views/kit/README.md | 22 ++++++++++++++++++++++ views/kit/default.nix | 19 +++++++++++++++++++ views/kit/workspace.josh | 8 ++++++++ 5 files changed, 57 insertions(+) create mode 100644 views/.skip-subtree create mode 100644 views/README.md create mode 100644 views/kit/README.md create mode 100644 views/kit/default.nix create mode 100644 views/kit/workspace.josh diff --git a/views/.skip-subtree b/views/.skip-subtree new file mode 100644 index 0000000000..d33c73476b --- /dev/null +++ b/views/.skip-subtree @@ -0,0 +1,2 @@ +//views is not part of the depot build tree, see the README for more +information. diff --git a/views/README.md b/views/README.md new file mode 100644 index 0000000000..83464d5ee2 --- /dev/null +++ b/views/README.md @@ -0,0 +1,6 @@ +depot views +=========== + +This folder contains external views of depot content, defined using +josh workspaces. See the individual views for a description of their +content and usage information. diff --git a/views/kit/README.md b/views/kit/README.md new file mode 100644 index 0000000000..9fb32efb4b --- /dev/null +++ b/views/kit/README.md @@ -0,0 +1,22 @@ +The TVL Kit +=========== + +This folder contains a publicly available version of the core TVL +tooling, currently comprising of: + +* `buildkite`: TVL tooling for dynamically generating Buildkite + pipelines with Nix. +* `buildGo`: Nix-based build system for Go. +* `readTree`: Nix library to dynamically compute attribute trees + corresponding to the physical layout of a repository. +* `besadii`: Configurable Gerrit/Buildkite integration hook. + +It can be accessed via git by cloning it as such: + + git clone https://code.tvl.fyi/depot.git:workspace=views/kit.git tvl-kit + +If you are looking at this within the TVL depot, you can see the +[josh][] configuration in `workspace.josh`. You will find the projects +at slightly different paths within the depot. + +[josh]: https://github.com/josh-project/josh/ diff --git a/views/kit/default.nix b/views/kit/default.nix new file mode 100644 index 0000000000..759b36997a --- /dev/null +++ b/views/kit/default.nix @@ -0,0 +1,19 @@ +# Externally importable TVL depot stack. This is intended to be called +# with a supplied package set, otherwise the package set currently in +# use by the TVL depot will be used. +# +# For now, readTree is not used inside of this configuration to keep +# it simple. Adding it may be useful if we set up test scaffolding +# around the exported workspace. + +{ pkgs ? import ./nixpkgs { depotOverlays = false; }, ... }: + +pkgs.lib.fix(self: { + buildGo = import ./buildGo { inherit pkgs; }; + buildkite = import ./buildkite { inherit pkgs; }; + readTree = import ./readTree { }; + + besadii = import ./besadii { + depot.nix.buildGo = self.buildGo; + }; +}) diff --git a/views/kit/workspace.josh b/views/kit/workspace.josh new file mode 100644 index 0000000000..33ca3e22e6 --- /dev/null +++ b/views/kit/workspace.josh @@ -0,0 +1,8 @@ +::LICENSE +besadii = :/ops/besadii +:/nix:[ + ::buildGo/ + ::buildkite/ + ::readTree/ +] +nixpkgs = :/third_party/nixpkgs -- cgit 1.4.1