From 89911efe11e34b9e412b45bf095bdc1aafa4e800 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Thu, 14 Aug 2025 23:26:28 +0300 Subject: [PATCH] gnuradio.pkgs.mkDerivation: Allow finalAttrs pattern --- pkgs/development/gnuradio-modules/mkDerivation.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/development/gnuradio-modules/mkDerivation.nix b/pkgs/development/gnuradio-modules/mkDerivation.nix index 960ecd413439..b18e24b6a2bc 100644 --- a/pkgs/development/gnuradio-modules/mkDerivation.nix +++ b/pkgs/development/gnuradio-modules/mkDerivation.nix @@ -7,6 +7,9 @@ mkDerivation: args: +let +# Common validation and processing logic +processArgs = args: # Check if it's supposed to not get built for the current gnuradio version if (builtins.hasAttr "disabled" args) && args.disabled then let @@ -35,4 +38,12 @@ else ]; }; in - mkDerivation (args // args_) + args // args_; + +in +if builtins.isFunction args then + # Function form: args is (finalAttrs -> attrset) + mkDerivation (finalAttrs: processArgs (args finalAttrs)) +else + # Attrset form: args is attrset + mkDerivation (processArgs args)