We are migrating packages that meet below requirements:
1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration
The tool is here: https://github.com/Aleksanaa/by-name-migrate.
The indentation stripping semantics of strings are fairly bad and have a
few gotchas where the resulting string has not the intended indentation.
This commit fixes most if not all such instances in Nixpkgs.
I tried to strive a balance between keeping the diff small and
reformatting/refactoring the code to look better. In general,
reformatting should be left to Nixfmt.
Note that this causes a lot of rebuilds by design. All changes need to
be thoroughly vetted and reviewed for correctness. There is no automatic
way to prove correctness.
List of files to fix generated by running
https://gerrit.lix.systems/c/lix/+/2092 on Nixpkgs and looking at the
warnings.
The hash of the fixed derivation changed
If the old derivation with the hash was cached on the system, the
build failed with:
```
ERROR: /build/output/external/googletest~1.14.0.bcr.1/BUILD.bazel:80:11: Compiling googletest/src/gtest.cc failed: The include path '/nix/store/p5w6cmwqfvhyaf4vjr7jb18a90icrrr2-openjdk-21.0.3+9/include' references a path outside of the execution root.
ERROR: /build/output/external/abseil-cpp~20240116.2/absl/base/BUILD.bazel:755:11: Compiling absl/base/internal/strerror.cc failed: The include path '/nix/store/p5w6cmwqfvhyaf4vjr7jb18a90icrrr2-openjdk-21.0.3+9/include' references a path outside of the execution root.
```
This indicates that the derivation also bakes in the path of the used
JDK, which apparently changed since last time. Quick fix for now:
adapt hash, but hopefully there could be a more long-term solution.