From 7f5ae56a4bc9da4428ea84cbf4bcaa9f51bf8976 Mon Sep 17 00:00:00 2001 From: Chris Moultrie <821688+tebriel@users.noreply.github.com> Date: Sat, 7 Mar 2026 11:44:30 -0500 Subject: [PATCH] grocy: Add config abilities to module --- nixos/modules/services/web-apps/grocy.nix | 54 ++++++++++++++++++++++- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/web-apps/grocy.nix b/nixos/modules/services/web-apps/grocy.nix index be12b854b526..d6095b50fa8a 100644 --- a/nixos/modules/services/web-apps/grocy.nix +++ b/nixos/modules/services/web-apps/grocy.nix @@ -79,22 +79,39 @@ in culture = mkOption { type = types.enum [ - "de" - "en" + "bg_BG" + "ca" + "cs" "da" + "de" + "el_GR" + "en" "en_GB" "es" + "et_EE" + "fi" "fr" + "he_IL" "hu" "it" + "ja" + "ko_KR" + "lt" "nl" "no" "pl" "pt_BR" + "pt_PT" + "ro_RO" "ru" "sk_SK" + "sl" "sv_SE" + "ta" "tr" + "uk" + "zh_CN" + "zh_TW" ]; default = "en"; description = '' @@ -119,6 +136,37 @@ in ''; }; }; + + entryPage = mkOption { + # https://github.com/grocy/grocy/blob/v4.6.0/config-dist.php#L75-L78 + type = types.enum [ + "stock" + "shoppinglist" + "recipes" + "chores" + "tasks" + "batteries" + "equipment" + "calendar" + "mealplan" + ]; + default = "stock"; + description = '' + Specify an custom homepage if desired. + ''; + }; + }; + + extraConfig = mkOption { + type = types.lines; + default = ""; + description = '' + These lines go at the end of config.php verbatim. + ''; + example = '' + Setting('FEATURE_FLAG_RECIPES', false); + Setting('FEATURE_FLAG_STOCK_PRODUCT_FREEZING', false); + ''; }; }; @@ -129,6 +177,8 @@ in Setting('CURRENCY', '${cfg.settings.currency}'); Setting('CALENDAR_FIRST_DAY_OF_WEEK', '${toString cfg.settings.calendar.firstDayOfWeek}'); Setting('CALENDAR_SHOW_WEEK_OF_YEAR', ${boolToString cfg.settings.calendar.showWeekNumber}); + Setting('ENTRY_PAGE', '${cfg.settings.entryPage}'); + ${cfg.extraConfig} ''; users.users.grocy = {