NixOS/modules/servers/mealie.nix

29 lines
889 B
Nix

{ lib, config, ... }:
let
cfg = config.my.servers.mealie;
setup = import ../factories/setup.nix { inherit lib config; };
in
{
options.my.servers.mealie = setup.mkOptions "mealie" "mealie" 9925;
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;
};
};
}