[Nix-dev] daemon in httpd subservice

Andreas Herrmann andreash87 at gmx.ch
Tue Jul 22 22:52:40 CEST 2014


Hi guys,

Unfortunately, I still haven't solved this problem.

To be a bit more precise on the issue:

I have a httpd subservice which contains a PHP based web-app (TTRSS) that
uses postgresql as a database. All that works fine.
However, it also requires a daemon to run in order to update the RSS/Atom
feeds on a regular basis. (I would prefer the daemon over a cron job).

You can observe my current progress here [1]. My idea is the following: I
have one file (`ttrss-service.nix`) that contains the httpd subservice, and
another file (`ttrss-update.nix`) that contains the update daemon.
Unfortunately, the update daemon needs to know the exact installation
location of ttrss (`ttrssRoot`), and that one depends on the configuration
of the subservice. (Because the config file needs to be stored in that
directory as well.)
So, the issue boils down to one question: How can I extract the
installation path (`ttrssRoot`) from the httpd subservice?
That question appears at [2] in the code.

Of course, if you have a better idea how to tackle TTRSS, please let me
know.


On a side note: I first experimented with a simpler case on how to get a
daemon running in NixOS. You can find the results in [3].
It works. However, if you think that this is the wrong way to configure a
service in NixOS please let me know.

Best regards,

Andreas


[1]:
https://github.com/aherrmann/nixops-ttrss-test/tree/a899bc571b8c581f85cf7d92270e168d67535374
[2]:
https://github.com/aherrmann/nixops-ttrss-test/blob/a899bc571b8c581f85cf7d92270e168d67535374/ttrss.nix#L39
[3]:
https://github.com/aherrmann/nixops-deamon-test/tree/a495c8930267c488217a7b3a4dd9722006638903
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20140722/6a22fb0c/attachment.html 


More information about the nix-dev mailing list