NixOS/modules/servers/mealie.nix
2025-10-12 13:41:48 -06:00

33 lines
860 B
Nix

{
lib,
config,
inputs,
...
}:
let
cfg = config.my.servers.mealie;
in
{
options.my.servers.mealie = inputs.self.lib.mkServerOptions "mealie" "mealie" 9925 lib;
config = lib.mkIf (cfg.enable && config.my.secureHost) {
sops.secrets.mealie.sopsFile = ../../secrets/env.yaml;
services.mealie = {
inherit (cfg) enable port;
settings = {
TZ = config.my.timeZone;
DEFAULT_GROUP = "Home";
BASE_URL = cfg.url;
API_DOCS = "false";
ALLOW_SIGNUP = "false";
DB_ENGINE = "postgres";
POSTGRES_URL_OVERRIDE = "postgresql://${cfg.name}:@/${cfg.name}?host=${config.my.postgresSocket}";
MAX_WORKERS = "1";
WEB_CONCURRENCY = "1";
SMTP_HOST = "smtp.gmail.com";
SMTP_PORT = "587";
};
credentialsFile = config.sops.secrets.mealie.path;
};
};
}