diff --git a/pkgs/development/haskell-modules/with-packages-wrapper.nix b/pkgs/development/haskell-modules/with-packages-wrapper.nix
index e50672221eb7..ac887a3f60e4 100644
--- a/pkgs/development/haskell-modules/with-packages-wrapper.nix
+++ b/pkgs/development/haskell-modules/with-packages-wrapper.nix
@@ -52,7 +52,7 @@ buildEnv {
     . ${makeWrapper}/nix-support/setup-hook
 
     ${optionalString ghc.isGhcjs ''
-    cp -r ${ghc}/${ghc.libDir}/* ${libDir}/
+    cp -r "${ghc}/${ghc.libDir}/"* ${libDir}/
     ''}
 
     if test -L "$out/bin"; then