diff --git a/pkgs/servers/http/nginx/generic.nix b/pkgs/servers/http/nginx/generic.nix index 0d38e49d6276..23f42fa49df4 100644 --- a/pkgs/servers/http/nginx/generic.nix +++ b/pkgs/servers/http/nginx/generic.nix @@ -206,8 +206,8 @@ stdenv.mkDerivation { postInstall = let - noSourceRefs = lib.concatMapStrings (m: "remove-references-to -t ${m.src} $out/bin/nginx\n") modules; - in noSourceRefs + postInstall; + noSourceRefs = lib.concatMapStrings (m: "remove-references-to -t ${m.src} $(readlink -fn $out/bin/nginx)\n") modules; + in postInstall + noSourceRefs; passthru = { inherit modules;