From 956d1447d187093fcaffa845a44515bef506f880 Mon Sep 17 00:00:00 2001 From: Austreelis Date: Wed, 1 Oct 2025 01:25:51 +0000 Subject: [PATCH] fix: example aux packages eval (#25) - add namespace for `aux.a`, `aux.b`, `aux.c`'s builder config - break an infinite recursion of `aux.a`'s install phase depending on its own derivation's `outPath` Co-authored-by: austreelis Reviewed-on: https://git.auxolotl.org/auxolotl/labs/pulls/25 Reviewed-by: vlinkz Co-authored-by: Austreelis Co-committed-by: Austreelis --- tidepool/src/packages/aux/a.nix | 30 ++++++++++++++++++------------ tidepool/src/packages/aux/b.nix | 2 +- tidepool/src/packages/aux/c.nix | 2 +- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/tidepool/src/packages/aux/a.nix b/tidepool/src/packages/aux/a.nix index 692adff..f640b44 100644 --- a/tidepool/src/packages/aux/a.nix +++ b/tidepool/src/packages/aux/a.nix @@ -27,23 +27,29 @@ in } ]; - builder = builders.basic; + builder = builders.foundation.basic; deps.host.host = { inherit (packages.aux) b; }; - phases = ctx: { - install = '' - echo "a with b: ${config.deps.host.host.b.platform.host}" > $out - echo >> $out - echo a=$out >> $out - echo b=$AUX_B >> $out - echo c=$AUX_C >> $out - echo >> $out - echo '${ctx}' >> $out - ''; - }; + phases = + ctx': + let + # break recursion on the derivation outPath itself + ctx = builtins.removeAttrs ctx' [ "package" ]; + in + { + install = '' + echo "a with b: ${config.deps.host.host.b.platform.host}" > $out + echo >> $out + echo a=$out >> $out + echo b=$AUX_B >> $out + echo c=$AUX_C >> $out + echo >> $out + echo '${ctx}' >> $out + ''; + }; }; }; }; diff --git a/tidepool/src/packages/aux/b.nix b/tidepool/src/packages/aux/b.nix index 141be66..92a75da 100644 --- a/tidepool/src/packages/aux/b.nix +++ b/tidepool/src/packages/aux/b.nix @@ -33,7 +33,7 @@ in custom = true; - builder = builders.basic; + builder = builders.foundation.basic; deps = { build = { diff --git a/tidepool/src/packages/aux/c.nix b/tidepool/src/packages/aux/c.nix index 96229a8..024918c 100644 --- a/tidepool/src/packages/aux/c.nix +++ b/tidepool/src/packages/aux/c.nix @@ -38,7 +38,7 @@ in custom = true; - builder = builders.basic; + builder = builders.foundation.basic; context = { "foundation:cflags" = [ "-I $AUX_C/include" ];