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 = { options = {
build.imagesToLoad = lib.mkOption { build.imagesToLoad = lib.mkOption {
type = listOf unspecified; type = listOf unspecified;
internal = true;
description = "List of dockerTools image derivations."; description = "List of dockerTools image derivations.";
}; };
}; };

View file

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

View file

@ -14,6 +14,6 @@ in
}; };
}; };
config = { 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; inherit (lib.types) attrsOf unspecified;
in in
{ {
imports = [
(lib.mkRenamedOptionModule ["build" "extendedInfo"] ["out" "extendedInfo"])
];
options = { options = {
build.extendedInfo = mkOption { out.extendedInfo = mkOption {
type = attrsOf unspecified; type = attrsOf unspecified;
description = '' description = ''
Information about a service to include in the Docker Compose file, Information about a service to include in the Docker Compose file,