anchor.diff:      ln -s $i nix/var/nix/gcroots/docker/$(basename $i)
       done;
     '';
  +
  +  # Map nixpkgs architecture to Docker notation
  +  # Reference: https://github.com/docker-library/official-images#architectures-other-than-amd64
  +  getArch = nixSystem: {
  +    aarch64-linux = "arm64v8";
  +    armv7l-linux = "arm32v7";
  +    x86_64-linux = "amd64";
  +    powerpc64le-linux = "ppc64le";
  +    i686-linux = "i386";
  +  }.${nixSystem} or "Can't map Nix system ${nixSystem} to Docker architecture notation. Please check that your input and your requested build are correct or update the mapping in Nixpkgs.";
   
   in
   rec {
  
positive.code:   writeScript,
    writeText,
    writePython3,
  }:
  
  # WARNING: this API is unstable and may be subject to backwards-incompatible changes in the future.
  
negative.code:       streamScript = writePython3 "stream" {} ./stream_layered_image.py;
        baseJson = writeText "${name}-base.json" (builtins.toJSON {
           inherit config;
           architecture = getArch system;
           os = "linux";
        });
  
  