From 47e958cd9a67c7f46baacfae62df1a7ce4f5bde3 Mon Sep 17 00:00:00 2001 From: Eman Resu <78693624+quatquatt@users.noreply.github.com> Date: Wed, 3 Jun 2026 18:12:36 -0400 Subject: [PATCH] lib.modules: inline mergedType into a lower scope This will only be used if `res ? type` (which is barely ever true, since there's typically only ever one decl). We can avoid the thunk in every case. --- lib/modules.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/modules.nix b/lib/modules.nix index c53cd8185e91..474040c270df 100644 --- a/lib/modules.nix +++ b/lib/modules.nix @@ -1043,10 +1043,11 @@ let ( res: opt: let - mergedType = res.type.typeMerge opt.options.type.functor; - typeSet = if opt.options ? type && res ? type then + let + mergedType = res.type.typeMerge opt.options.type.functor; + in if mergedType != null then { type = mergedType;