Rename, refactor, hide build.imagesToLoad

imagesToLoad is not the right api for non-service images.
This commit is contained in:
Robert Hensing 2019-10-03 21:54:54 +02:00
parent c3a5f8c13f
commit c8f7f5a6d3
4 changed files with 12 additions and 11 deletions

View file

@ -28,6 +28,7 @@ in
options = {
build.imagesToLoad = lib.mkOption {
type = listOf unspecified;
internal = true;
description = "List of dockerTools image derivations.";
};
};

View file

@ -5,16 +5,13 @@
*/
{ config, lib, ... }:
let
inherit (lib) mapAttrs filterAttrs;
serviceInfo =
lib.mapAttrs getInfo (
lib.filterAttrs filterFunction config.services
);
filterFunction = _serviceName: service:
# shallow equality suffices for emptiness test
builtins.attrNames service.build.extendedInfo != [];
getInfo = _serviceName: service: service.build.extendedInfo;
filterAttrs (_k: v: v != {})
(mapAttrs (_serviceName: service: service.out.extendedInfo)
config.services
);
in
{

View file

@ -14,6 +14,6 @@ in
};
};
config = {
build.extendedInfo.defaultExec = config.service.defaultExec;
out.extendedInfo.defaultExec = config.service.defaultExec;
};
}

View file

@ -4,8 +4,11 @@ let
inherit (lib.types) attrsOf unspecified;
in
{
imports = [
(lib.mkRenamedOptionModule ["build" "extendedInfo"] ["out" "extendedInfo"])
];
options = {
build.extendedInfo = mkOption {
out.extendedInfo = mkOption {
type = attrsOf unspecified;
description = ''
Information about a service to include in the Docker Compose file,