maintainers/scripts/haskell: fix regenerate-transitive-broken

- use `restrict-eval` so that we're not affected by the user's environment
- use jq instead of the horrible echo+sed hack

The second point also fixes the indentation before each line to be two
spaces instead of one, so I set it back to one space to avoid a diff.

+3 -3
+2 -2
maintainers/scripts/haskell/regenerate-transitive-broken-packages.sh
··· 1 1 #! /usr/bin/env nix-shell 2 - #! nix-shell -i bash -p coreutils nix gnused -I nixpkgs=. 2 + #! nix-shell -i bash -p coreutils jq nix -I nixpkgs=. 3 3 4 4 config_file=pkgs/development/haskell-modules/configuration-hackage2nix/transitive-broken.yaml 5 5 ··· 12 12 EOF 13 13 14 14 echo "Regenerating list of transitive broken packages ..." 15 - echo -e $(nix-instantiate --eval --strict maintainers/scripts/haskell/transitive-broken-packages.nix) | sed 's/\"//' | LC_ALL=C.UTF-8 sort -i >> $config_file 15 + nix-instantiate --eval --option restrict-eval true -I . --strict --json maintainers/scripts/haskell/transitive-broken-packages.nix | jq -r . | LC_ALL=C.UTF-8 sort -i >> $config_file
+1 -1
maintainers/scripts/haskell/transitive-broken-packages.nix
··· 12 12 (getEvaluating (nixpkgs { config.allowBroken = true; }).haskellPackages); 13 13 in 14 14 '' 15 - ${lib.concatMapStringsSep "\n" (x: " - ${x}") brokenDeps} 15 + ${lib.concatMapStringsSep "\n" (x: " - ${x}") brokenDeps} 16 16 ''