From 38b39dd404feb6229110ddbc08bdb834a797b4ee Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Thu, 11 Jan 2024 17:25:31 +0000 Subject: ruby-modules/bundled-common: do not define `gemType` for `null` packages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without the change `gemType` gets defined via `null` attrset that exposes unevaluatable attribute: nix-repl> ronin.gemType error: … while evaluating the attribute 'gemType' at pkgs/development/ruby-modules/bundled-common/default.nix:122:30: 121| inherit ruby bundler gems confFiles envPaths; 122| inherit (gems.${pname}) gemType; | ^ 123| … while evaluating an attribute name error: value is null while a string was expected After the change `passthru` does not expose a `gemType` if `pname` is `null`. --- pkgs/development/ruby-modules/bundled-common/default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'pkgs/development/ruby-modules') diff --git a/pkgs/development/ruby-modules/bundled-common/default.nix b/pkgs/development/ruby-modules/bundled-common/default.nix index 86c885b52dcb..6aca502550b6 100644 --- a/pkgs/development/ruby-modules/bundled-common/default.nix +++ b/pkgs/development/ruby-modules/bundled-common/default.nix @@ -117,9 +117,10 @@ let meta = { platforms = ruby.meta.platforms; } // meta; - passthru = rec { - inherit ruby bundler gems confFiles envPaths; + passthru = (lib.optionalAttrs (pname != null) { inherit (gems.${pname}) gemType; + } // rec { + inherit ruby bundler gems confFiles envPaths; wrappedRuby = stdenv.mkDerivation { name = "wrapped-ruby-${pname'}"; @@ -172,7 +173,7 @@ let exit 1 ''; }; - }; + }); }; basicEnv = -- cgit 1.4.1