Created
November 22, 2017 16:38
-
-
Save cransom/c34c90e0f8301a30ea854fc6ed4c09a5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import <nixpkgs/nixos/tests/make-test.nix> { | |
nodes = { | |
testvm = | |
{ config, lib, pkgs, ... }: | |
let | |
CacheMemcachedlibmemcached = buildPerlPackage rec { | |
name = "Cache-Memcached-libmemcached-0.04001"; | |
src = fetchurl { | |
url = "mirror://cpan/authors/id/T/TI/TIMB/${name}.tar.gz"; | |
sha256 = "e5dffe00ee0018dcd12708cbe214f7ea679ba2fad86f16da9dbce11f0215e5d2"; | |
}; | |
propagatedBuildInputs = [ Memcachedlibmemcached perlPackages.TaskWeaken ]; | |
doCheck = false; | |
meta = { | |
description = "Cache interface to Memcached::libmemcached"; | |
license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ]; | |
}; | |
}; | |
Memcachedlibmemcached = buildPerlPackage rec { | |
name = "Memcached-libmemcached-1.001801"; | |
src = fetchurl { | |
url = "mirror://cpan/authors/id/S/SE/SEANBURKE/${name}.tar.gz"; | |
sha256 = "aa07972fdb74cffde6b7fee648a3a58d3129af22e06a073d1388d778f6e8dca5"; | |
}; | |
doCheck = false; | |
makeMakerFlags = ''LIBS=-L${stdenv.cc.cc.lib}/lib INC=-I${pkgs.glibc}/include''; #-L${stdenv.cc.cc.lib}/lib"''; | |
buildInputs = [ pkgs.libmemcached pkgs.libevent ]; | |
patches = ./lm.patch; | |
}; | |
inherit (pkgs) perlPackages apacheHttpd perl stdenv buildPerlPackage | |
fetchurl lib; | |
inherit (perlPackages) buildPerlModule; | |
mod_apreq2 = stdenv.mkDerivation { | |
name = "mod_apreq2"; | |
src = perlPackages.libapreq2.src; | |
CPPFLAGS="-I${pkgs.apacheHttpdPackages.mod_perl}/include"; | |
configureFlags = [ "--enable-perl-glue --with-apxs2=${apacheHttpd.dev}/bin/apxs" ]; | |
preConfigurePhase = ''export APACHE_INCLUDES="-I${pkgs.apacheHttpdPackages.mod_perl}/include -I${pkgs.apacheHttpd.dev}/include"''; | |
buildInputs = with pkgs; [ coreutils perlPackages.ExtUtilsXSBuilder apacheHttpd.dev apacheHttpd perl expat perlPackages.libapreq2 perlPackages.mod_perl2]; | |
propagatedBuildInputs = [ pkgs.apacheHttpdPackages.mod_perl ]; | |
doCheck = false; | |
installPhase = '' | |
mkdir -p $out | |
make install DESTDIR=$out | |
mv $out${apacheHttpd}/* $out | |
mv $out${apacheHttpd.dev}/* $out | |
mv $out${perl}/* $out | |
rm $out/nix -rf | |
''; | |
}; | |
in | |
{ | |
environment.systemPackages = [ pkgs.vim ]; | |
services.httpd = { | |
enable = true; | |
enablePerl = true; | |
listen = [ { ip = "0.0.0.0"; port = 1244; }]; | |
extraModules = [ | |
{ name = "apreq"; path = "${mod_apreq2}/modules/mod_apreq2.so"; } | |
]; | |
adminAddr = "nobody@example.com"; | |
virtualHosts = [ | |
{ documentRoot = "/tmp"; | |
#serverName = "perl"; | |
extraConfig = '' | |
PerlSwitches -C | |
<Perl> | |
use lib qw( | |
${Memcachedlibmemcached}/lib/perl5/site_perl | |
${CacheMemcachedlibmemcached}/lib/perl5/site_perl | |
); | |
use Cache::Memcached::libmemcached qw (); | |
</Perl> | |
PerlModule ScoopDK::ApacheHandler | |
SetHandler modperl | |
''; | |
} | |
]; | |
}; | |
}; | |
}; | |
testScript = '' | |
startAll; | |
#$testvm->waitForUnit("httpd"); | |
sleep 10; | |
$testvm->succeed("systemctl status httpd"); | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment