From f789d163ccdb4a46e3e80ff38ed4f793e92a922b Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Wed, 27 Mar 2019 22:04:31 +0100 Subject: [PATCH] Add error context to image building functions --- src/nix/modules/composition/images.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/nix/modules/composition/images.nix b/src/nix/modules/composition/images.nix index 9a9b04c..bedf8e8 100644 --- a/src/nix/modules/composition/images.nix +++ b/src/nix/modules/composition/images.nix @@ -7,11 +7,13 @@ let lib.filterAttrs filterFunction config.docker-compose.evaluatedServices ); - filterFunction = _serviceName: service: - service.config.image.nixBuild; + filterFunction = serviceName: service: + builtins.addErrorContext "while evaluating whether the service ${serviceName} defines an image" + service.config.image.nixBuild; - addDetails = _serviceName: service: - let + addDetails = serviceName: service: + builtins.addErrorContext "while evaluating the image for service ${serviceName}" + (let inherit (service.config) build; in { image = build.image.outPath; @@ -20,7 +22,7 @@ let if build.image.imageTag != "" then build.image.imageTag else lib.head (lib.strings.splitString "-" (baseNameOf build.image.outPath)); - }; + }); in { options = {