liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit e6ca5ea0642f8a1f9cfa8214a8919fe55615625b
parent e6e4665a180b38ef4225d85b63fb8ed1101a77cc
Author: Daniel Barlow <dan@telent.net>
Date:   Tue, 11 Jun 2024 14:01:06 +0100

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

Diffstat:
Mpkgs/default.nix | 2+-
Mpkgs/liminix-tools/services/builder.sh | 13++++++++++---
Mpkgs/liminix-tools/services/default.nix | 5+----
3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/pkgs/default.nix b/pkgs/default.nix @@ -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; }); }; diff --git a/pkgs/liminix-tools/services/builder.sh b/pkgs/liminix-tools/services/builder.sh @@ -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 diff --git a/pkgs/liminix-tools/services/default.nix b/pkgs/liminix-tools/services/default.nix @@ -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; };