summary refs log tree commit diff
path: root/pkgs/servers/http/nginx/nix-etag-1.15.4.patch
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2019-04-18 10:07:55 +0200
committeraszlig <aszlig@nix.build>2019-04-18 10:07:55 +0200
commit1f24685d93e96581b65d8c30a0c8eac903d82052 (patch)
tree03e33f2ae1217ace0277194896fc7369bb073ecf /pkgs/servers/http/nginx/nix-etag-1.15.4.patch
parentd533285224de23354f445f728049e7758d686f20 (diff)
downloadnixpkgs-1f24685d93e96581b65d8c30a0c8eac903d82052.tar
nixpkgs-1f24685d93e96581b65d8c30a0c8eac903d82052.tar.gz
nixpkgs-1f24685d93e96581b65d8c30a0c8eac903d82052.tar.bz2
nixpkgs-1f24685d93e96581b65d8c30a0c8eac903d82052.tar.lz
nixpkgs-1f24685d93e96581b65d8c30a0c8eac903d82052.tar.xz
nixpkgs-1f24685d93e96581b65d8c30a0c8eac903d82052.tar.zst
nixpkgs-1f24685d93e96581b65d8c30a0c8eac903d82052.zip
nginx/etag-patch: Use Nix store dir from build env
So far, the Nix store directory was hardcoded and if someone uses a
different Nix store directory the patch won't work. Of course, this is
pretty uncommon, but by not only substituting the store directory but
also the length of it we also save a few calls to ngx_strlen(), which
should save us a few cycles.

Signed-off-by: aszlig <aszlig@nix.build>
Diffstat (limited to 'pkgs/servers/http/nginx/nix-etag-1.15.4.patch')
-rw-r--r--pkgs/servers/http/nginx/nix-etag-1.15.4.patch4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkgs/servers/http/nginx/nix-etag-1.15.4.patch b/pkgs/servers/http/nginx/nix-etag-1.15.4.patch
index 1a8dcb4303a..9dec715bf6c 100644
--- a/pkgs/servers/http/nginx/nix-etag-1.15.4.patch
+++ b/pkgs/servers/http/nginx/nix-etag-1.15.4.patch
@@ -36,8 +36,8 @@ index c57ec00c..b7992de2 100644
 -                                  r->headers_out.last_modified_time,
 -                                  r->headers_out.content_length_n)
 -                      - etag->value.data;
-+    #define NIX_STORE_DIR "/nix/store"
-+    #define NIX_STORE_LEN ngx_strlen(NIX_STORE_DIR)
++    #define NIX_STORE_DIR "@nixStoreDir@"
++    #define NIX_STORE_LEN @nixStoreDirLen@
 +
 +    if (r->headers_out.last_modified_time == 1
 +        && !ngx_strncmp(real, NIX_STORE_DIR, NIX_STORE_LEN)