about summary refs log tree commit diff
path: root/pkgs/development/ruby-modules/bundled-common/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/ruby-modules/bundled-common/default.nix')
-rw-r--r--pkgs/development/ruby-modules/bundled-common/default.nix9
1 files changed, 5 insertions, 4 deletions
diff --git a/pkgs/development/ruby-modules/bundled-common/default.nix b/pkgs/development/ruby-modules/bundled-common/default.nix
index 2aea35844fe5..354353ffab11 100644
--- a/pkgs/development/ruby-modules/bundled-common/default.nix
+++ b/pkgs/development/ruby-modules/bundled-common/default.nix
@@ -7,6 +7,7 @@
 {
   name
 , pname ? name
+, mainGemName ? null
 , gemdir ? null
 , gemfile ? null
 , lockfile ? null
@@ -44,13 +45,13 @@ let
 
   copyIfBundledByPath = { bundledByPath ? false, ...}@main:
   (if bundledByPath then
-      assert gemFiles.gemdir != nil; "cp -a ${gemFiles.gemdir}/* $out/"
+      assert gemFiles.gemdir != null; "cp -a ${gemFiles.gemdir}/* $out/"
     else ""
   );
 
-  maybeCopyAll = pname: if pname == null then "" else
+  maybeCopyAll = pkgname: if pkgname == null then "" else
   let
-    mainGem = gems."${pname}" or (throw "bundlerEnv: gem ${pname} not found");
+    mainGem = gems."${pkgname}" or (throw "bundlerEnv: gem ${pkgname} not found");
   in
     copyIfBundledByPath mainGem;
 
@@ -59,7 +60,7 @@ let
   # out. Yes, I'm serious.
   confFiles = runCommand "gemfile-and-lockfile" {} ''
     mkdir -p $out
-    ${maybeCopyAll pname}
+    ${maybeCopyAll mainGemName}
     cp ${gemFiles.gemfile} $out/Gemfile || ls -l $out/Gemfile
     cp ${gemFiles.lockfile} $out/Gemfile.lock || ls -l $out/Gemfile.lock
   '';