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.
This commit is contained in:
Vincent Ambo 2019-09-30 14:19:11 +01:00 committed by Vincent Ambo
parent 2c8ef634f6
commit 6262dec8aa
3 changed files with 69 additions and 9 deletions

View file

@ -20,10 +20,20 @@
{ pkgs ? import <nixpkgs> {} }:
pkgs.writeShellScriptBin "nixery-build-image" ''
exec ${pkgs.nix}/bin/nix-build \
--show-trace \
--no-out-link "$@" \
--argstr loadPkgs ${./load-pkgs.nix} \
${./build-image.nix}
''
{
build-image = pkgs.writeShellScriptBin "nixery-build-image" ''
exec ${pkgs.nix}/bin/nix-build \
--show-trace \
--no-out-link "$@" \
--argstr loadPkgs ${./load-pkgs.nix} \
${./build-image.nix}
'';
build-layers = pkgs.writeShellScriptBin "nixery-build-layers" ''
exec ${pkgs.nix}/bin/nix-build \
--show-trace \
--no-out-link "$@" \
--argstr loadPkgs ${./load-pkgs.nix} \
${./build-layers.nix}
'';
}