services: add mealie
This commit is contained in:
parent
59f24701a3
commit
dedbbed14b
|
@ -9,6 +9,7 @@
|
|||
./jellyfin.nix
|
||||
./lohr.nix
|
||||
./matrix.nix
|
||||
./mealie.nix
|
||||
./media.nix
|
||||
./microbin.nix
|
||||
./miniflux.nix
|
||||
|
|
55
services/mealie.nix
Normal file
55
services/mealie.nix
Normal file
|
@ -0,0 +1,55 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit
|
||||
(lib)
|
||||
mkEnableOption
|
||||
mkIf
|
||||
mkOption
|
||||
;
|
||||
|
||||
cfg = config.my.services.mealie;
|
||||
my = config.my;
|
||||
|
||||
domain = config.networking.domain;
|
||||
hostname = config.networking.hostName;
|
||||
fqdn = "${hostname}.${domain}";
|
||||
in {
|
||||
options.my.services.mealie = let
|
||||
inherit (lib) types;
|
||||
in {
|
||||
enable = mkEnableOption "Mealie";
|
||||
port = mkOption {
|
||||
type = types.port;
|
||||
example = 8080;
|
||||
description = "Internal port for Mealie webapp";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.mealie = {
|
||||
enable = true;
|
||||
listenAddress = "127.0.0.1";
|
||||
port = cfg.port;
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."mealie.${domain}" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = fqdn;
|
||||
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:${toString cfg.port}/";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
|
||||
security.acme.certs.${fqdn}.extraDomainNames = ["mealie.${domain}"];
|
||||
|
||||
my.services.restic-backup = {
|
||||
paths = ["/var/lib/mealie"];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue