From 22842dedeeae431648b0234188d70ad98b830f79 Mon Sep 17 00:00:00 2001 From: Eman Resu <78693624+quatquatt@users.noreply.github.com> Date: Sat, 27 Jun 2026 18:00:32 -0400 Subject: [PATCH] lib.sources.toSourceAttributes: default filter to null --- lib/sources.nix | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/sources.nix b/lib/sources.nix index fe2d06bd7318..48e141baa0e3 100644 --- a/lib/sources.nix +++ b/lib/sources.nix @@ -162,7 +162,8 @@ let in fromSourceAttributes { inherit (orig) origSrc; - filter = path: type: filter path type && orig.filter path type; + filter = + if orig.filter == null then filter else path: type: filter path type && orig.filter path type; name = if name != null then name else orig.name; }; @@ -191,11 +192,14 @@ let attrs // { filter = - path: type: - let - r = attrs.filter path type; - in - builtins.trace "${attrs.name}.filter ${path} = ${boolToString r}" r; + if attrs.filter == null then + path: type: builtins.trace "${attrs.name}.filter ${path} = true" true + else + path: type: + let + r = attrs.filter path type; + in + builtins.trace "${attrs.name}.filter ${path} = ${boolToString r}" r; } ) // { @@ -416,7 +420,7 @@ let { # The original path origSrc = if isFiltered then src.origSrc else src; - filter = if isFiltered then src.filter else _: _: true; + filter = if isFiltered then src.filter else null; # make sure to handle this! name = if isFiltered then src.name else "source"; };