@@ -6,15 +6,20 @@
66 * see also `call-cabal-project-to-nix`!
77 */
88{ runCommand, nix-tools, pkgs }:
9−{ src, stackYaml ? null }:
9+{ src, stackYaml ? null, ignorePackageYaml ? false }:
1010let
11+ stackToNixArgs = builtins.concatStringsSep " " [
12+ "--stack-yaml=${src}/${if stackYaml == null then "stack.yaml" else stackYaml}"
13+ (if ignorePackageYaml then "--ignore-package-yaml" else "")
14+ "-o ."
15+ ];
1116 stack = runCommand "stack-to-nix-pkgs" {
1217 nativeBuildInputs = [ nix-tools pkgs.nix-prefetch-git ];
1318 } ''
1419 export LANG=C.utf8 # Needed or stack-to-nix will die on unicode inputs
1520 mkdir -p $out
1621
17− (cd $out && stack-to-nix --stack-yaml=${src}/${if stackYaml == null then "stack.yaml" else stackYaml} -o .)
22+ (cd $out && stack-to-nix ${stackToNixArgs})
1823
1924 # We need to strip out any references to $src, as those won't
2025 # be accessable in restricted mode.
@@ -35,4 +40,4 @@ runCommand "stack-to-nix-pkgs-with-src" { nativeBuildInputs = [ pkgs.rsync ]; }
3540 # nix sandboxing is enabled (since it can prevent nix from moving the directory
3641 # out of the chroot sandbox).
3742 chmod +w $out
38−''
43+''