1<chapter xmlns="http://docbook.org/ns/docbook"
2 xmlns:xlink="http://www.w3.org/1999/xlink"
3 xmlns:xi="http://www.w3.org/2001/XInclude"
4 version="5.0"
5 xml:id="module-services-grocy">
6
7 <title>Grocy</title>
8 <para>
9 <link xlink:href="https://grocy.info/">Grocy</link> is a web-based self-hosted groceries
10 & household management solution for your home.
11 </para>
12
13 <section xml:id="module-services-grocy-basic-usage">
14 <title>Basic usage</title>
15 <para>
16 A very basic configuration may look like this:
17<programlisting>{ pkgs, ... }:
18{
19 services.grocy = {
20 <link linkend="opt-services.grocy.enable">enable</link> = true;
21 <link linkend="opt-services.grocy.hostName">hostName</link> = "grocy.tld";
22 };
23}</programlisting>
24 This configures a simple vhost using <link linkend="opt-services.nginx.enable">nginx</link>
25 which listens to <literal>grocy.tld</literal> with fully configured ACME/LE (this can be
26 disabled by setting <link linkend="opt-services.grocy.nginx.enableSSL">services.grocy.nginx.enableSSL</link>
27 to <literal>false</literal>). After the initial setup the credentials <literal>admin:admin</literal>
28 can be used to login.
29 </para>
30 <para>
31 The application's state is persisted at <literal>/var/lib/grocy/grocy.db</literal> in a
32 <package>sqlite3</package> database. The migration is applied when requesting the <literal>/</literal>-route
33 of the application.
34 </para>
35 </section>
36
37 <section xml:id="module-services-grocy-settings">
38 <title>Settings</title>
39 <para>
40 The configuration for <literal>grocy</literal> is located at <literal>/etc/grocy/config.php</literal>.
41 By default, the following settings can be defined in the NixOS-configuration:
42<programlisting>{ pkgs, ... }:
43{
44 services.grocy.settings = {
45 # The default currency in the system for invoices etc.
46 # Please note that exchange rates aren't taken into account, this
47 # is just the setting for what's shown in the frontend.
48 <link linkend="opt-services.grocy.settings.currency">currency</link> = "EUR";
49
50 # The display language (and locale configuration) for grocy.
51 <link linkend="opt-services.grocy.settings.currency">culture</link> = "de";
52
53 calendar = {
54 # Whether or not to show the week-numbers
55 # in the calendar.
56 <link linkend="opt-services.grocy.settings.calendar.showWeekNumber">showWeekNumber</link> = true;
57
58 # Index of the first day to be shown in the calendar (0=Sunday, 1=Monday,
59 # 2=Tuesday and so on).
60 <link linkend="opt-services.grocy.settings.calendar.firstDayOfWeek">firstDayOfWeek</link> = 2;
61 };
62 };
63}</programlisting>
64 </para>
65 <para>
66 If you want to alter the configuration file on your own, you can do this manually with
67 an expression like this:
68<programlisting>{ lib, ... }:
69{
70 environment.etc."grocy/config.php".text = lib.mkAfter ''
71 // Arbitrary PHP code in grocy's configuration file
72 '';
73}</programlisting>
74 </para>
75 </section>
76
77</chapter>