about summary refs log tree commit diff
path: root/tools/nixery/default.nix
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2019-09-30T13·19+0100
committerVincent Ambo <github@tazj.in>2019-10-03T12·21+0100
commit6262dec8aacf25ae6004de739353089cd635cea5 (patch)
tree98da57af6cba292c63901510ed9b49bc9dcf63ca /tools/nixery/default.nix
parent2c8ef634f67f91c8efc1cf6a58a271f4c44544dd (diff)
feat(nix): Add derivation to create layer tars from a store path set
This introduces a new Nix derivation that, given an attribute set of
layer hashes mapped to store paths, will create a layer tarball for
each of the store paths.

This is going to be used by the builder to create layers that are not
present in the cache.

Relates to #50.
Diffstat (limited to 'tools/nixery/default.nix')
-rw-r--r--tools/nixery/default.nix7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/nixery/default.nix b/tools/nixery/default.nix
index f321b07a9c..925edbf6dc 100644
--- a/tools/nixery/default.nix
+++ b/tools/nixery/default.nix
@@ -11,13 +11,15 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+
 { pkgs ? import <nixpkgs> { }
 , preLaunch ? ""
 , extraPackages ? [] }:
 
 with pkgs;
 
-rec {
+let builders = import ./build-image { inherit pkgs; };
+in rec {
   # Go implementation of the Nixery server which implements the
   # container registry interface.
   #
@@ -27,7 +29,8 @@ rec {
   nixery-server = callPackage ./server { };
 
   # Implementation of the Nix image building logic
-  nixery-build-image = import ./build-image { inherit pkgs; };
+  nixery-build-image = builders.build-image;
+  nixery-build-layers = builders.build-layers;
 
   # Use mdBook to build a static asset page which Nixery can then
   # serve. This is primarily used for the public instance at