Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zoneminder: init at 1.32.3 and add NixOS module #53495

Merged
merged 5 commits into from Jan 18, 2019
Merged

Conversation

peterhoeg
Copy link
Member

@peterhoeg peterhoeg commented Jan 6, 2019

Motivation for this change

I needed ZoneMinder and now it works. Refer to the derivation for a lot of comments concerning why certain things are done the way they are.

Cc: @volth for the perl parts (and others of course)

UPDATE: while it works, there are a few parts that don't so I need to fix those before this is ready to merge. The architecture of this application is a complete mess....

UPDATE 2: now it works, including integration with home-assistant which will come in a separate PR.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@peterhoeg
Copy link
Member Author

It is just strange that I was not pinged authomatically as the code owner.

Only Infinisil was detected as code owner by GH.

@peterhoeg
Copy link
Member Author

Turns out there are a few parts not quite working yet - main features such as recording and motion detection are though. I need to fix those up before we merge.

@peterhoeg
Copy link
Member Author

@volth, any nicer way to handle PERL5LIB and the move to -I as done in the installPhase of zoneminder?

@peterhoeg
Copy link
Member Author

peterhoeg commented Jan 7, 2019 via email

@peterhoeg peterhoeg changed the title zoneminder: init at 1.32.3 and add NixOS module [WIP] zoneminder: init at 1.32.3 and add NixOS module Jan 9, 2019
@peterhoeg peterhoeg changed the title [WIP] zoneminder: init at 1.32.3 and add NixOS module zoneminder: init at 1.32.3 and add NixOS module Jan 10, 2019
@bachp
Copy link
Member

bachp commented Jan 11, 2019

I was able to sucessfully run this on a Raspberry Pi 3 on aarch64. However there were some issues I ran into:

  1. I had to disable the tests/checks for the perlPackages.SysCPU packages as they seems to fail on aarch64. @volth I think perl packages are not run on hydra for aarch64, do you know why?

  2. I had to figure out how to configure MySQL/MariaDB first as the service doesn't automatically configure the database. @peterhoeg This might be a nice enhancement.

@rycee
Copy link
Member

rycee commented Jan 11, 2019

Sorry, I don't know why Hydra doesn't build the perl packages for aarch64. Perhaps @grahamc knows?

@peterhoeg
Copy link
Member Author

I had to disable the tests/checks for the perlPackages.SysCPU packages as they seems to fail on aarch64. I think perl packages are not run on hydra for aarch64

Isn't the case that the packages are not built on aarch64 because the tests fail (for whatever reason)?

I had to figure out how to configure MySQL/MariaDB first as the service doesn't automatically configure the database. This might be a nice enhancement.

The DB user used by ZM shouldn't have permissions to create databases and database users. Of course we could use the nixos mechanism to create the db, but that assumes that the database is on the same host. This is the reason I didn't do this as my ZM install is different from the DB. Maybe the nicest option is to update the description for enable to inform the user and add a new option to create the database. Any thoughts?

@peterhoeg
Copy link
Member Author

In any case, I have just pushed the latest iteration. Working here on amd64.

@veprbl
Copy link
Member

veprbl commented Jan 15, 2019

@peterhoeg Just out of curiosity: did you look at all into declarative camera configuration? This is by no means a feature request, just a question.

@peterhoeg
Copy link
Member Author

did you look at all into declarative camera configuration

I thought about it, but didn't look into it. ZM is a bit of a mess where some things are defined at compile time, some things can be overridden using config files and most things are in the database.

The way to do cameras would be to define them in an attrset and generate the required sql (I understand mysql understands some variation of UPSERT).

I thought it was more important to get it out there first. We can always add features!

@peterhoeg
Copy link
Member Author

The patching of the package and the nixos module are both ugly - I'm very open to feedback to make this nicer.

@peterhoeg
Copy link
Member Author

I think getting ZM packaged is important so I am going to go ahead an merge this. Let's get some people using it and then make things nicer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants