7cf74389ad
To let services write to the x-arion section.
24 lines
597 B
Nix
24 lines
597 B
Nix
/*
|
|
Adds extendedInfo from services to the Docker Compose file.
|
|
|
|
This contains fields that are not in Docker Compose schema.
|
|
*/
|
|
{ config, lib, ... }:
|
|
let
|
|
serviceInfo =
|
|
lib.mapAttrs getInfo (
|
|
lib.filterAttrs filterFunction config.docker-compose.evaluatedServices
|
|
);
|
|
|
|
filterFunction = _serviceName: service:
|
|
# shallow equality suffices for emptiness test
|
|
builtins.attrNames service.config.build.extendedInfo != [];
|
|
|
|
getInfo = _serviceName: service: service.config.build.extendedInfo;
|
|
|
|
in
|
|
{
|
|
config = {
|
|
docker-compose.extended.serviceInfo = serviceInfo;
|
|
};
|
|
}
|