When adding modules to openresty, by either
- using `.override { modules = [ ..]; }` directly
- adding them to `services.nginx.additionalModules` or
- enabling e.g. something like `services.nginx.recommendedZstdSettings`
the build will then fail, as the actual `nginx` binary lands in
`nginx/bin/nginx` for openresty, and is only symlinked to `bin/nginx`
(and `bin/openresty`, for that matter).
This breaks the post-install script for nginx when removing references
to the aforementioned modules, since `remove-references-to` skips
symlinks. Thus, just read the symlink before in this case.
`readlink -fn` will read the symlink if it is one, otherwise just
returns the path itself.
The phase is also moved after the package-specific postInstall phase, at
that might move binaries around or create symlinks - as is the case for
openresty.
Can be easily reproduced using e.g.:
$ nix build --impure -E 'with import ./. {}; openresty.override { modules = [ nginxModules.zstd ]; }' -L
Signed-off-by: Christoph Heiss <christoph@c8h4.io>
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.
adding distutils, packaging and setuptools to fix:
- ModuleNotFoundError: No module named 'distutils'
- ModuleNotFoundError: No module named 'packaging'
- error: invalid command 'install'
and ensureNewerSourcesForZipFilesHook for:
- ValueError: ZIP does not support timestamps before 1980