grocy: Add config abilities to module

This commit is contained in:
Chris Moultrie
2026-03-09 21:31:48 -04:00
parent e99cf9c117
commit 7f5ae56a4b
+52 -2
View File
@@ -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 = {