setup mealie

This commit is contained in:
Joakim Repomaa
2025-02-17 12:09:37 +02:00
parent 4e09c07522
commit da0fab832c
6 changed files with 60 additions and 0 deletions

View File

@@ -12,6 +12,7 @@
"donetick"
"dnote"
"octodns"
"mealie"
]
) // {
smtp-password = {

View File

@@ -176,5 +176,17 @@ in
subdomain = "dns";
port = 3006;
};
mealie = {
enable = true;
subdomain = "cook";
credentialsFile = secrets.mealie.path;
settings = {
SMTP_HOST = smtp.host;
SMTP_FROM_EMAIL = smtp.from;
SMTP_USER = smtp.username;
SMTP_PORT = smtp.port;
};
};
};
}

View File

@@ -19,5 +19,6 @@
./dnote.nix
./octodns.nix
./adguardhome.nix
./mealie.nix
];
}

View File

@@ -0,0 +1,35 @@
{ lib, config, ... }:
let
cfg = config.services.mealie;
fqdn = "${cfg.subdomain}.${config.networking.domain}";
in
{
options.services.mealie = {
subdomain = lib.mkOption {
type = lib.types.str;
};
};
config = lib.mkIf cfg.enable {
services = {
mealie.settings = {
BASE_URL = "https://${fqdn}";
ALLOW_SIGNUP = true;
DB_ENGINE = "postgres";
POSTGRES_URL_OVERRIDE = "postgresql://mealie:@mealie?host=/var/run/postgresql";
SMTP_FROM_NAME = "Mealie";
};
webserver.vHosts.${fqdn}.locations."/".proxyPort = cfg.port;
postgresql = {
enable = lib.mkDefault true;
ensureDatabases = [ "mealie" ];
ensureUsers = [{
name = "mealie";
ensureDBOwnership = true;
}];
};
};
};
}

10
secrets/mealie.age Normal file
View File

@@ -0,0 +1,10 @@
age-encryption.org/v1
-> ssh-ed25519 osOCZA aSrfC3yY3hUP30pc7bxAeOQsI+oY5TlWLn5fRTEi0ns
1HWv0ZLTvzxP9+dE4Kvn2uCeqV9GF9isURPaVtVxelI
-> ssh-ed25519 DFiohQ BuD0HhnHWUVrykPxwJZ1kPMAUEEbcxQxs0rKTsiR8nE
nCT+Dh7rTh6EP5c/cBmE9DEFbl2oU3m0TPQv8jZKwuc
-> ssh-ed25519 PT7ffg pAoyCa+x5wME4MrcI4fLsdy7t8DdzxtViM3b1UJyjQA
ei7ZxGgqqa3mk5ZBrMFBPHN8Gvk5j1IxWuirX2mYGAI
--- K2ECMTGRrhkYrsBkcO7z+gl3tdsGLUwtj4QjZ4zdkUc
MfóîÔ}|¢F<C2A2>ýÌ"ï<€áÂ'j]ÓzI¼n÷Cí¸½¸ÏpàíÔ_ÜC„Nnžåbt´"214Waù·¬Móq5O-ãcüè˜æï,<2C>=~yÌs?Ûö6ωª8x-“Äh¥nqf)¸¥=O@8˜N,û"arÓñ8‘‡íÉ=–þ“ o
ªÐ%ôB(¦-

View File

@@ -20,4 +20,5 @@ in
"donetick.age".publicKeys = users ++ [ freun-dev ];
"dnote.age".publicKeys = users ++ [ freun-dev ];
"octodns.age".publicKeys = users ++ [ freun-dev ];
"mealie.age".publicKeys = users ++ [ freun-dev ];
}