Merge pull request #84952 from danielfullmer/zoneminder-php-fix

nixos/zoneminder: fix evaluation with new php refactor
This commit is contained in:
Elis Hirwing 2020-05-17 20:19:54 +02:00 committed by GitHub
commit 4437c3d366
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 10 deletions

View File

@ -63,10 +63,6 @@ let
${cfg.extraConfig} ${cfg.extraConfig}
''; '';
phpExtensions = with pkgs.phpPackages; [
{ pkg = apcu; name = "apcu"; }
];
in { in {
options = { options = {
services.zoneminder = with lib; { services.zoneminder = with lib; {
@ -289,11 +285,9 @@ in {
phpfpm = lib.mkIf useNginx { phpfpm = lib.mkIf useNginx {
pools.zoneminder = { pools.zoneminder = {
inherit user group; inherit user group;
phpPackage = pkgs.php.withExtensions ({ enabled, all }: enabled ++ [ all.apcu ]);
phpOptions = '' phpOptions = ''
date.timezone = "${config.time.timeZone}" date.timezone = "${config.time.timeZone}"
${lib.concatStringsSep "\n" (map (e:
"extension=${e.pkg}/lib/php/extensions/${e.name}.so") phpExtensions)}
''; '';
settings = lib.mapAttrs (name: lib.mkDefault) { settings = lib.mapAttrs (name: lib.mkDefault) {
"listen.owner" = user; "listen.owner" = user;

View File

@ -348,6 +348,7 @@ in
yabar = handleTest ./yabar.nix {}; yabar = handleTest ./yabar.nix {};
yggdrasil = handleTest ./yggdrasil.nix {}; yggdrasil = handleTest ./yggdrasil.nix {};
zfs = handleTest ./zfs.nix {}; zfs = handleTest ./zfs.nix {};
zsh-history = handleTest ./zsh-history.nix {}; zoneminder = handleTest ./zoneminder.nix {};
zookeeper = handleTest ./zookeeper.nix {}; zookeeper = handleTest ./zookeeper.nix {};
zsh-history = handleTest ./zsh-history.nix {};
} }

View File

@ -0,0 +1,23 @@
import ./make-test-python.nix ({ lib, ...}:
{
name = "zoneminder";
meta.maintainers = with lib.maintainers; [ danielfullmer ];
machine = { ... }:
{
services.zoneminder = {
enable = true;
database.createLocally = true;
database.username = "zoneminder";
};
time.timeZone = "America/New_York";
};
testScript = ''
machine.wait_for_unit("zoneminder.service")
machine.wait_for_unit("nginx.service")
machine.wait_for_open_port(8095)
machine.succeed("curl --fail http://localhost:8095/")
'';
})

View File

@ -1,7 +1,7 @@
{ stdenv, lib, fetchFromGitHub, fetchurl, substituteAll, cmake, makeWrapper, pkgconfig { stdenv, lib, fetchFromGitHub, fetchurl, substituteAll, cmake, makeWrapper, pkgconfig
, curl, ffmpeg, glib, libjpeg, libselinux, libsepol, mp4v2, libmysqlclient, mysql, pcre, perl, perlPackages , curl, ffmpeg, glib, libjpeg, libselinux, libsepol, mp4v2, libmysqlclient, mysql, pcre, perl, perlPackages
, polkit, utillinuxMinimal, x264, zlib , polkit, utillinuxMinimal, x264, zlib
, coreutils, procps, psmisc }: , coreutils, procps, psmisc, nixosTests }:
# NOTES: # NOTES:
# #
@ -172,7 +172,10 @@ in stdenv.mkDerivation rec {
"-DZM_WEB_GROUP=${user}" "-DZM_WEB_GROUP=${user}"
]; ];
passthru = { inherit dirName; }; passthru = {
inherit dirName;
tests = nixosTests.zoneminder;
};
postInstall = '' postInstall = ''
PERL5LIB="$PERL5LIB''${PERL5LIB:+:}$out/${perl.libPrefix}" PERL5LIB="$PERL5LIB''${PERL5LIB:+:}$out/${perl.libPrefix}"