3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/servers/varnish/default.nix
Christian Kauhaus ea7e705cd9 varnish: fix localstatedir for varnish* tools (#17508)
The varnish tools (varnishstat, varnishlog, ...) tried to load the VSM
file from a spurious var directory in the Nix store. Fix the default so
the tools "just work" when also keeping services.varnish.stateDir at the
default.

Notes:
- The tools use $localstatedir/$HOSTNAME so I've adapted the default for
  stateDir as well to contain hostName.
- Added postStop action to remove the localstatedir. There is no point
  in keeping it around when varnish does not run, as it regenerates it
  on startup anyway.

Fixes #7495
2016-08-04 15:25:23 +02:00

26 lines
779 B
Nix

{ stdenv, fetchurl, pcre, libxslt, groff, ncurses, pkgconfig, readline, python
, pythonPackages }:
stdenv.mkDerivation rec {
version = "4.0.3";
name = "varnish-${version}";
src = fetchurl {
url = "http://repo.varnish-cache.org/source/${name}.tar.gz";
sha256 = "01l2iypajkdanxpbvzfxm6vs4jay4dgw7lmchqidnivz15sa3fcl";
};
buildInputs = [ pcre libxslt groff ncurses pkgconfig readline python
pythonPackages.docutils];
buildFlags = "localstatedir=/var/spool";
meta = {
description = "Web application accelerator also known as a caching HTTP reverse proxy";
homepage = "https://www.varnish-cache.org";
license = stdenv.lib.licenses.bsd2;
maintainers = [ stdenv.lib.maintainers.garbas ];
platforms = stdenv.lib.platforms.linux;
};
}