diff --git a/nixos/modules/services/web-apps/grocy.md b/nixos/modules/services/web-apps/grocy.md new file mode 100644 index 000000000000..62aad4b103df --- /dev/null +++ b/nixos/modules/services/web-apps/grocy.md @@ -0,0 +1,66 @@ +# Grocy {#module-services-grocy} + +[Grocy](https://grocy.info/) is a web-based self-hosted groceries +& household management solution for your home. + +## Basic usage {#module-services-grocy-basic-usage} + +A very basic configuration may look like this: +``` +{ pkgs, ... }: +{ + services.grocy = { + enable = true; + hostName = "grocy.tld"; + }; +} +``` +This configures a simple vhost using [nginx](#opt-services.nginx.enable) +which listens to `grocy.tld` with fully configured ACME/LE (this can be +disabled by setting [services.grocy.nginx.enableSSL](#opt-services.grocy.nginx.enableSSL) +to `false`). After the initial setup the credentials `admin:admin` +can be used to login. + +The application's state is persisted at `/var/lib/grocy/grocy.db` in a +`sqlite3` database. The migration is applied when requesting the `/`-route +of the application. + +## Settings {#module-services-grocy-settings} + +The configuration for `grocy` is located at `/etc/grocy/config.php`. +By default, the following settings can be defined in the NixOS-configuration: +``` +{ pkgs, ... }: +{ + services.grocy.settings = { + # The default currency in the system for invoices etc. + # Please note that exchange rates aren't taken into account, this + # is just the setting for what's shown in the frontend. + currency = "EUR"; + + # The display language (and locale configuration) for grocy. + culture = "de"; + + calendar = { + # Whether or not to show the week-numbers + # in the calendar. + showWeekNumber = true; + + # Index of the first day to be shown in the calendar (0=Sunday, 1=Monday, + # 2=Tuesday and so on). + firstDayOfWeek = 2; + }; + }; +} +``` + +If you want to alter the configuration file on your own, you can do this manually with +an expression like this: +``` +{ lib, ... }: +{ + environment.etc."grocy/config.php".text = lib.mkAfter '' + // Arbitrary PHP code in grocy's configuration file + ''; +} +``` diff --git a/nixos/modules/services/web-apps/grocy.nix b/nixos/modules/services/web-apps/grocy.nix index 6efc2ccfd302..1716f27ccad7 100644 --- a/nixos/modules/services/web-apps/grocy.nix +++ b/nixos/modules/services/web-apps/grocy.nix @@ -167,6 +167,8 @@ in { meta = { maintainers = with maintainers; [ ma27 ]; + # Don't edit the docbook xml directly, edit the md and generate it: + # `pandoc grocy.md -t docbook --top-level-division=chapter --extract-media=media -f markdown-smart --lua-filter ../../../../doc/build-aux/pandoc-filters/myst-reader/roles.lua --lua-filter ../../../../doc/build-aux/pandoc-filters/docbook-writer/rst-roles.lua > grocy.xml` doc = ./grocy.xml; }; } diff --git a/nixos/modules/services/web-apps/grocy.xml b/nixos/modules/services/web-apps/grocy.xml index 025c08721c62..b02627aaafeb 100644 --- a/nixos/modules/services/web-apps/grocy.xml +++ b/nixos/modules/services/web-apps/grocy.xml @@ -1,57 +1,58 @@ - - + Grocy - Grocy is a web-based self-hosted groceries - & household management solution for your home. + Grocy is a web-based + self-hosted groceries & household management solution for your + home. -
- Basic usage - - A very basic configuration may look like this: - + Basic usage + + A very basic configuration may look like this: + + { pkgs, ... }: { services.grocy = { enable = true; - hostName = "grocy.tld"; + hostName = "grocy.tld"; }; } - This configures a simple vhost using nginx - which listens to grocy.tld with fully configured ACME/LE (this can be - disabled by setting services.grocy.nginx.enableSSL - to false). After the initial setup the credentials admin:admin - can be used to login. - - - The application's state is persisted at /var/lib/grocy/grocy.db in a - sqlite3 database. The migration is applied when requesting the /-route - of the application. - + + This configures a simple vhost using + nginx which + listens to grocy.tld with fully configured + ACME/LE (this can be disabled by setting + services.grocy.nginx.enableSSL + to false). After the initial setup the + credentials admin:admin can be used to login. + + + The application's state is persisted at + /var/lib/grocy/grocy.db in a + sqlite3 database. The migration is applied when + requesting the /-route of the application. +
-
- Settings - - The configuration for grocy is located at /etc/grocy/config.php. - By default, the following settings can be defined in the NixOS-configuration: - + Settings + + The configuration for grocy is located at + /etc/grocy/config.php. By default, the + following settings can be defined in the NixOS-configuration: + + { pkgs, ... }: { services.grocy.settings = { # The default currency in the system for invoices etc. # Please note that exchange rates aren't taken into account, this # is just the setting for what's shown in the frontend. - currency = "EUR"; + currency = "EUR"; # The display language (and locale configuration) for grocy. - culture = "de"; + culture = "de"; calendar = { # Whether or not to show the week-numbers @@ -65,19 +66,17 @@ }; } - - - If you want to alter the configuration file on your own, you can do this manually with - an expression like this: - + + If you want to alter the configuration file on your own, you can + do this manually with an expression like this: + + { lib, ... }: { - environment.etc."grocy/config.php".text = lib.mkAfter '' + environment.etc."grocy/config.php".text = lib.mkAfter '' // Arbitrary PHP code in grocy's configuration file ''; } -
-