nixos/zoneminder: update on startup if needed

This commit is contained in:
Daniel Fullmer 2020-02-09 13:28:32 -05:00
parent 630de551ef
commit cb5da4eacb

View File

@ -77,6 +77,8 @@ in {
`config.services.zoneminder.database.createLocally` to true. Otherwise, `config.services.zoneminder.database.createLocally` to true. Otherwise,
when set to `false` (the default), you will have to create the database when set to `false` (the default), you will have to create the database
and database user as well as populate the database yourself. and database user as well as populate the database yourself.
Additionally, you will need to run `zmupdate.pl` yourself when
upgrading to a newer version.
''; '';
webserver = mkOption { webserver = mkOption {
@ -330,6 +332,8 @@ in {
${config.services.mysql.package}/bin/mysql < ${pkg}/share/zoneminder/db/zm_create.sql ${config.services.mysql.package}/bin/mysql < ${pkg}/share/zoneminder/db/zm_create.sql
touch "/var/lib/${dirName}/db-created" touch "/var/lib/${dirName}/db-created"
fi fi
${zoneminder}/bin/zmupdate.pl -nointeractive
''; '';
serviceConfig = { serviceConfig = {
User = user; User = user;