Change:
Zoneminder, but it seems there is no code that handles upgrades, while that is provided by upstream and for example the Ubuntu packaging. It seems to be more of a developer preview version on NixOS than something that could be used by end-users in a production environment. I would have a flag like that needs to be set to true before it does something for that reason. I welcome the progress that has been made, but it doesn't appear to be in good enough shape to compete with other solutions. I will open another issue for adding declarative camera support (), because there was another user who also wanted to have that, which should also make this issue smaller.
Looking at zoneminder_1.30.4+dfsg- in debian/TODO.Debian it says: and there is no mention of the in the scripts. Are you sure Ubuntu has support for this? My personal opinion is that automatic upgrades are not such a great thing. While there are provided migrations to upgrade the database, there doesn't seem to be an official way to downgrade. This conflicts with the nature of Nix where we expect seamless version changes in any direction. Having user manually run ensures that they are aware of the upgrade and prepared for consequences.
has recently changed, but I have seen it upgrade automatically and there was at some point some code for doing it automatically. The manual part here only seems to be the ppa configuration. The main point is that the effort required on Ubuntu is less than on NixOS.
Yes, I see that this PPA with an unofficial zoneminder package (from Ubuntu standpoint) does indeed run in its zoneminder.postinst script.
I wasn't aware of this issue until just now, hence the rather late reply. That is correct - so far we have only released a single version in nixpkgs but of course it will come back and bite us. Things can break in unstable - nothing new there and unless we hit security issues, new versions will not be back-ported, so that at least gives us to 19.09 to sort out. What other options (packaged for NixOS) do we have? I personally have very strong reservations about the architectural choices the ZM developers have made, but I am not aware of any real alternative ATM. Declarative camera support is definitely a good idea. I support for ZM because I needed it and it solves my problem right now (until we need to update of course), but any PR would be very much welcome.
The is already part of the package - we just don't do anything with it and according to the comment in the header: But then of course it does have functionality for dealing with a number of changes. So the short version - someone just has to write (and test) how it behaves when upgraded and ensure this runs. I am realistically not going to work on that right now though.

Discussion:
`config.services.zoneminder.database.createLocally` to true. Otherwise, when set to `false` (the default), you will have to create the database and database user as well as populate the database yourself. <ins> Additionally, you will need to run `zmupdate.pl` yourself when upgrading to a newer version. </ins> ''; webserver = mkOption {

${config.services.mysql.package}/bin/mysql < ${pkg}/share/zoneminder/db/zm_create.sql touch "/var/lib/${dirName}/db-created" fi <ins> ${zoneminder}/bin/zmupdate.pl -nointeractive </ins> ''; serviceConfig = { User = user;

<ins> From db38a11228eceea10dc97ecc87023b4919caa918 Mon Sep 17 00:00:00 2001 From: Daniel Fullmer <danielrf12@gmail.com> Date: Fri, 21 Feb 2020 21:52:00 -0500 Subject: [PATCH] Don't use file timestamp in cache filename Every file in the nix store has a timestamp of "1", meaning that the filename would remain constant even when changing zoneminder versions. This would mean that newer versions would use the existing symlink to an older version of the source file.  We replace SRC_HASH in nix with a hash of the source used to build zoneminder to ensure this filename is unique. --- web/includes/functions.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/includes/functions.php b/web/includes/functions.php index 19567a5c1..0242c09bc 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -2223,7 +2223,8 @@ function cache_bust($file) { $parts = pathinfo($file); global $css; $dirname = preg_replace('///', '_', $parts['dirname']); -  $cacheFile = $dirname.'_'.$parts['filename'].'-'.$css.'-'.filemtime($file).'.'.$parts['extension']; +  $srcHash = '@srcHash@'; +  $cacheFile = $dirname.'_'.$parts['filename'].'-'.$css.'-'.$srcHash.'.'.$parts['extension']; if ( file_exists(ZM_DIR_CACHE.'/'.$cacheFile) or symlink(ZM_PATH_WEB.'/'.$file, ZM_DIR_CACHE.'/'.$cacheFile) ) { return 'cache/'.$cacheFile; } else { -- 2.25.1 </ins>

<del> { stdenv, lib, fetchFromGitHub, fetchurl, cmake, makeWrapper, pkgconfig </del> <ins> { stdenv, lib, fetchFromGitHub, fetchurl, substituteAll, cmake, makeWrapper, pkgconfig </ins> , curl, ffmpeg, glib, libjpeg, libselinux, libsepol, mp4v2, libmysqlclient, mysql, pcre, perl, perlPackages , polkit, utillinuxMinimal, x264, zlib , coreutils, procps, psmisc }:

in stdenv.mkDerivation rec { pname = "zoneminder"; <del> version = "1.32.3"; </del> <ins> version = "1.34.3"; </ins> src = fetchFromGitHub { owner  = "ZoneMinder"; repo   = "zoneminder"; rev    = version; <del> sha256 = "1sx2fn99861zh0gp8g53ynr1q6yfmymxamn82y54jqj6nv475njz"; </del> <ins> sha256 = "0jp7950v36gxxzkwdp5i0312s26czhfsl5ixdxfzn21cx31hhlg0"; </ins> }; patches = [ ./default-to-http-1dot1.patch <del> # Explicitly link with dynamic linking library to fix build ./link-with-libdl.patch </del> <ins> ./0001-Don-t-use-file-timestamp-in-cache-filename.patch </ins> ]; postPatch = ''

substituteInPlace scripts/zmdbbackup.in  --replace /usr/bin/mysqldump ${mysql.client}/bin/mysqldump <ins> substituteInPlace scripts/zmupdate.pl.in  --replace "'mysql'" "'${mysql.client}/bin/mysql'"  --replace "'mysqldump'" "'${mysql.client}/bin/mysqldump'" </ins> for f in scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in  scripts/zmupdate.pl.in  src/zm_config.h.in 

substituteInPlace $f --replace @ZM_CONFIG_SUBDIR@ /etc/zoneminder done <del> for f in includes/Event.php views/image.php skins/classic/views/image-ffmpeg.php ; do substituteInPlace web/$f  --replace "'ffmpeg " "'${ffmpeg}/bin/ffmpeg " done </del> <ins> for f in includes/Event.php views/image.php ; do substituteInPlace web/$f  --replace "'ffmpeg " "'${ffmpeg}/bin/ffmpeg " done substituteInPlace web/includes/functions.php  --replace "'date " "'${coreutils}/bin/date "  --subst-var-by srcHash "`basename $out`" </ins> ''; buildInputs = [

DateManip DBI DBDmysql LWP SysMmap # run-time dependencies not checked at build-time ClassStdFast DataDump DeviceSerialPort JSONMaybeXS LWPProtocolHttps NumberBytesHuman SysCPU SysMemInfo TimeDate <ins> CryptEksblowfish DataEntropy # zmupdate.pl </ins> ]); nativeBuildInputs = [ cmake makeWrapper pkgconfig ];

<del> --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -20,10 +20,10 @@ add_executable(zms zms.cpp) include_directories(libbcrypt/include/bcrypt) include_directories(jwt-cpp/include/jwt-cpp) -target_link_libraries(zmc zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS}) -target_link_libraries(zma zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS}) -target_link_libraries(zmu zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS}) -target_link_libraries(zms zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS}) +target_link_libraries(zmc zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS} ${CMAKE_DL_LIBS}) +target_link_libraries(zma zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS} ${CMAKE_DL_LIBS}) +target_link_libraries(zmu zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS} ${CMAKE_DL_LIBS}) +target_link_libraries(zms zm ${ZM_EXTRA_LIBS} ${ZM_BIN_LIBS} ${CMAKE_DL_LIBS}) # Generate man files for the binaries destined for the bin folder FOREACH(CBINARY zma zmc zmu) </del>