Files
dotfiles/platforms/nixos/modules/nmasur/presets/services/mealie.nix
2025-11-11 04:00:51 +00:00

41 lines
948 B
Nix

{ config, lib, ... }:
let
inherit (config.nmasur.settings) hostnames;
cfg = config.nmasur.presets.services.mealie;
in
{
options.nmasur.presets.services.mealie.enable = lib.mkEnableOption "mealie recipe manager";
config = lib.mkIf cfg.enable {
services.mealie = {
enable = true;
port = 9099;
database.createLocally = true;
listenAddress = "127.0.0.1";
};
nmasur.presets.services.caddy.routes = [
{
match = [ { host = [ hostnames.recipes ]; } ];
handle = [
{
handler = "reverse_proxy";
upstreams = [ { dial = "localhost:${builtins.toString config.services.mealie.port}"; } ];
}
];
}
];
# Configure Cloudflare DNS to point to this machine
services.cloudflare-dyndns.domains = [ hostnames.recipes ];
# Point localhost to the local domain
networking.hosts."127.0.0.1" = [ hostnames.recipes ];
};
}