Compare commits
3 commits
9625578bd3
...
bc8a1874f9
| Author | SHA1 | Date | |
|---|---|---|---|
| bc8a1874f9 | |||
| 98cb7ab565 | |||
| 7065c56ce9 |
4 changed files with 80 additions and 0 deletions
BIN
hosts/nixos/porthos/secrets/mealie/mail.age
Normal file
BIN
hosts/nixos/porthos/secrets/mealie/mail.age
Normal file
Binary file not shown.
|
|
@ -41,6 +41,10 @@ in
|
|||
publicKeys = all;
|
||||
};
|
||||
|
||||
"mealie/mail.age" = {
|
||||
publicKeys = all;
|
||||
};
|
||||
|
||||
"miniflux/credentials.age".publicKeys = all;
|
||||
|
||||
"monitoring/password.age" = {
|
||||
|
|
|
|||
|
|
@ -68,6 +68,10 @@ in
|
|||
secretFile = secrets."matrix/sliding-sync-secret".path;
|
||||
};
|
||||
};
|
||||
mealie = {
|
||||
enable = true;
|
||||
credentialsFile = secrets."mealie/mail".path;
|
||||
};
|
||||
miniflux = {
|
||||
enable = true;
|
||||
credentialsFiles = secrets."miniflux/credentials".path;
|
||||
|
|
|
|||
72
modules/nixos/services/mealie/default.nix
Normal file
72
modules/nixos/services/mealie/default.nix
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
cfg = config.my.services.mealie;
|
||||
in
|
||||
{
|
||||
options.my.services.mealie = with lib; {
|
||||
enable = mkEnableOption "Mealie service";
|
||||
|
||||
port = mkOption {
|
||||
type = types.port;
|
||||
default = 4537;
|
||||
example = 8080;
|
||||
description = "Internal port for webui";
|
||||
};
|
||||
|
||||
credentialsFile = mkOption {
|
||||
type = types.str;
|
||||
example = "/var/lib/mealie/credentials.env";
|
||||
description = ''
|
||||
Configuration file for secrets.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.mealie = {
|
||||
enable = true;
|
||||
inherit (cfg) port credentialsFile;
|
||||
|
||||
settings = {
|
||||
# Basic settings
|
||||
BASE_URL = "https://mealie.${config.networking.domain}";
|
||||
TZ = config.time.timeZone;
|
||||
ALLOw_SIGNUP = "false";
|
||||
|
||||
# Use PostgreSQL
|
||||
DB_ENGINE = "postgres";
|
||||
POSTGRES_USER = "mealie";
|
||||
POSTGRES_PASSWORD = "";
|
||||
POSTGRES_SERVER = "/run/postgresql";
|
||||
# Pydantic and/or mealie doesn't handle the URI correctly, hijack it
|
||||
# with query parameters...
|
||||
POSTGRES_DB = "mealie?host=/run/postgresql&dbname=mealie";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services = {
|
||||
mealie = {
|
||||
after = [ "postgresql.service" ];
|
||||
requires = [ "postgresql.service" ];
|
||||
};
|
||||
};
|
||||
|
||||
# Set-up database
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
ensureDatabases = [ "mealie" ];
|
||||
ensureUsers = [
|
||||
{
|
||||
name = "mealie";
|
||||
ensureDBOwnership = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
my.services.nginx.virtualHosts = {
|
||||
mealie = {
|
||||
inherit (cfg) port;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue