@@ -24,15 +24,12 @@ let
2424
2525 subDir' = src.origSubDir or "";
2626 subDir = pkgs.lib.strings.removePrefix "/" subDir';
27− maybeCleanedSource =
28− if haskellLib.canCleanSource src
29− then (haskellLib.cleanSourceWith {
30− name = if name != null then "${name}-root-cabal-files" else "source-root-cabal-files";
31− src = src.origSrc or src;
32− filter = path: type: (!(src ? filter) || src.filter path type) && (
33− type == "directory" ||
34− pkgs.lib.any (i: (pkgs.lib.hasSuffix i path)) [ stackYaml ".cabal" "package.yaml" ]); })
35− else src.origSrc or src;
27+ cleanedSource = (haskellLib.cleanSourceWith {
28+ name = if name != null then "${name}-root-cabal-files" else "source-root-cabal-files";
29+ src = src.origSrc or src;
30+ filter = path: type: (!(src ? filter) || src.filter path type) && (
31+ type == "directory" ||
32+ pkgs.lib.any (i: (pkgs.lib.hasSuffix i path)) [ stackYaml ".cabal" "package.yaml" ]); });
3633
3734 stackToNixArgs = builtins.concatStringsSep " " [
3835 "--full"
@@ -59,14 +56,14 @@ let
5956 mkdir -p $out${subDir'}
6057 SRC=$(mktemp -d)
6158 cd $SRC
62− # if maybeCleanedSource is empty, this means it's a new
59+ # if cleanedSource is empty, this means it's a new
6360 # project where the files haven't been added to the git
6461 # repo yet. We fail early and provide a useful error
6562 # message to prevent headaches (#290).
66− if [ -z "$(ls -A ${maybeCleanedSource})" ]; then
63+ if [ -z "$(ls -A ${cleanedSource})" ]; then
6764 echo "cleaned source is empty. Did you forget to 'git add -A'?"; exit 1;
6865 fi
69− lndir -silent "${maybeCleanedSource}/." $SRC
66+ lndir -silent "${cleanedSource}/." $SRC
7067 ${pkgs.lib.optionalString (subDir != "") "cd ${subDir}"}
7168 ${
7269 # If a resolver was fetched use the it instead of the original stack.yaml