store derivations not just names for service deps
.. also controllers, contents. This is to make it possible (easier) to work out transitive dependencies at build time
This commit is contained in:
parent
e6e4665a18
commit
e6ca5ea064
@ -27,7 +27,7 @@ in {
|
||||
s = pkg (checkTypes parameters
|
||||
(builtins.removeAttrs args ["dependencies"]));
|
||||
in s.overrideAttrs (o: {
|
||||
dependencies = (builtins.map (d: d.name) dependencies) ++ o.dependencies;
|
||||
dependencies = dependencies ++ o.dependencies;
|
||||
buildInputs = dependencies ++ o.buildInputs;
|
||||
});
|
||||
};
|
||||
|
@ -3,15 +3,22 @@ mkdir -p $out/${name}
|
||||
echo $serviceType > $out/${name}/type
|
||||
mkdir -p $out/${name}/dependencies.d
|
||||
echo $buildInputs > $out/buildInputs
|
||||
test -n "$dependencies" && for d in $dependencies; do
|
||||
test -n "$dependencies" && for path in $dependencies; do
|
||||
d=$(dirname $(cd ${path} && ls -d */type))
|
||||
touch $out/${name}/dependencies.d/$d
|
||||
done
|
||||
test -n "$contents" && for d in $contents; do
|
||||
test -n "$contents" && for path in $contents; do
|
||||
d=$(dirname $(cd ${path} && ls -d */type))
|
||||
mkdir -p $out/${name}/contents.d
|
||||
touch $out/${name}/contents.d/$d
|
||||
done
|
||||
|
||||
for i in controllerName timeout-up timeout-down run notification-fd up down finish consumer-for producer-for pipeline-name restart-on-upgrade; do
|
||||
if test -n "$controller" ; then
|
||||
d=$(dirname $(cd ${controller} && ls -d */type))
|
||||
echo "$d)" > $out/${name}/controller
|
||||
fi
|
||||
|
||||
for i in timeout-up timeout-down run notification-fd up down finish consumer-for producer-for pipeline-name restart-on-upgrade; do
|
||||
test -n "$(printenv $i)" && (echo "$(printenv $i)" > $out/${name}/$i)
|
||||
done
|
||||
|
||||
|
@ -48,10 +48,7 @@ let
|
||||
producer-for consumer-for pipeline-name timeout-up timeout-down;
|
||||
restart-on-upgrade = isTrigger;
|
||||
buildInputs = buildInputs ++ dependencies ++ contents ++ lib.optional (controller != null) controller;
|
||||
dependencies = map (d: d.name) dependencies;
|
||||
contents = map (d: d.name) contents;
|
||||
inherit controller;
|
||||
controllerName = if controller ? name then controller.name else null;
|
||||
inherit controller dependencies contents;
|
||||
builder = ./builder.sh;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user