From b79c1b2f9a2972e240c67e1cd345e1c805bb7f3c Mon Sep 17 00:00:00 2001 From: musjj <72612857+musjj@users.noreply.github.com> Date: Sun, 1 Mar 2026 20:46:33 +0700 Subject: [PATCH 1/3] fix include-less parametric in provides --- nix/lib.nix | 6 ++- .../modules/features/provides-parametric.nix | 40 +++++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 templates/ci/modules/features/provides-parametric.nix diff --git a/nix/lib.nix b/nix/lib.nix index 524df79a7..ed780f41f 100644 --- a/nix/lib.nix +++ b/nix/lib.nix @@ -13,7 +13,9 @@ let aspect // { __functor = self: ctx: { - includes = builtins.filter (x: x != { }) (map (apply ctx) (builtins.filter isFn self.includes)); + includes = builtins.filter (x: x != { }) ( + map (apply ctx) (builtins.filter isFn (self.includes or [ ])) + ); }; }; @@ -35,7 +37,7 @@ let self: { class, aspect-chain }: { - includes = map (applyStatics { inherit class aspect-chain; }) self.includes; + includes = map (applyStatics { inherit class aspect-chain; }) (self.includes or [ ]); }; }; diff --git a/templates/ci/modules/features/provides-parametric.nix b/templates/ci/modules/features/provides-parametric.nix new file mode 100644 index 000000000..fd15fc338 --- /dev/null +++ b/templates/ci/modules/features/provides-parametric.nix @@ -0,0 +1,40 @@ +{ denTest, inputs, ... }: +{ + + flake.tests.provides-parametric = { + + test-parametric-inside-provides = denTest ( + { + den, + ns, + igloo, + ... + }: + { + den.hosts.x86_64-linux.igloo.users.tux = { }; + + imports = [ (inputs.den.namespace "ns" false) ]; + + ns.foo = den.lib.parametric { }; + ns.bar.provides.baz = den.lib.parametric { }; + ns.a = den.lib.parametric { + provides.b = den.lib.parametric { }; + provides.c = den.lib.parametric { nixos.networking.hostName = "pinguino"; }; + }; + + den.aspects.igloo.includes = [ + ns.foo + ns.bar._.baz + ns.a + ns.a._.b + ns.a._.c + ]; + + expr = igloo.networking.hostName; + expected = "pinguino"; + } + ); + + }; + +} From 0cb769b06c83bc52ea47b9363f9a39fd1d52f8d1 Mon Sep 17 00:00:00 2001 From: musjj <72612857+musjj@users.noreply.github.com> Date: Mon, 2 Mar 2026 02:35:17 +0700 Subject: [PATCH 2/3] update flake-aspects to include a bug fix --- templates/ci/flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/templates/ci/flake.lock b/templates/ci/flake.lock index 7c09f0841..c361ed32c 100644 --- a/templates/ci/flake.lock +++ b/templates/ci/flake.lock @@ -17,11 +17,11 @@ }, "flake-aspects": { "locked": { - "lastModified": 1771395573, - "narHash": "sha256-bcCOG2CW23/Eww/zULJf1xd0Shz2zS4c2AJWwLALyJ8=", + "lastModified": 1772393050, + "narHash": "sha256-lu8y40rGSps8U3ak0xhieLxSA4Dv/fJiPGkknjteEfk=", "owner": "vic", "repo": "flake-aspects", - "rev": "8297f3bc41ad79b9f01d56d0dd92f7aac51bacfb", + "rev": "d9502abaa6acc3a444b45a9df729d22f5ccff33c", "type": "github" }, "original": { From 12ecbe5aa67b5ff2122696fd4cc68fc9c2b61b08 Mon Sep 17 00:00:00 2001 From: musjj <72612857+musjj@users.noreply.github.com> Date: Mon, 2 Mar 2026 02:35:34 +0700 Subject: [PATCH 3/3] deepen nesting of provides to catch bugs --- templates/ci/modules/features/provides-parametric.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/templates/ci/modules/features/provides-parametric.nix b/templates/ci/modules/features/provides-parametric.nix index fd15fc338..be801a475 100644 --- a/templates/ci/modules/features/provides-parametric.nix +++ b/templates/ci/modules/features/provides-parametric.nix @@ -19,7 +19,10 @@ ns.bar.provides.baz = den.lib.parametric { }; ns.a = den.lib.parametric { provides.b = den.lib.parametric { }; - provides.c = den.lib.parametric { nixos.networking.hostName = "pinguino"; }; + provides.c = den.lib.parametric { }; + provides.d = den.lib.parametric { + provides.e = den.lib.parametric { nixos.networking.hostName = "pinguino"; }; + }; }; den.aspects.igloo.includes = [ @@ -28,6 +31,8 @@ ns.a ns.a._.b ns.a._.c + ns.a._.d + ns.a._.d._.e ]; expr = igloo.networking.hostName;