Compare commits

..

No commits in common. "586a0907d46a378db0fa6f290fd1bb42c04e9d63" and "6d5a9538a7aab0714d6cd047fc106c60f977a24a" have entirely different histories.

2 changed files with 54 additions and 0 deletions

View file

@ -58,6 +58,12 @@
doBackups = true;
};
memos = {
enable = true;
domain = "memos.${privateDomain}";
doBackups = true;
};
actualbudget = {
enable = true;
domain = "budget.${privateDomain}";

View file

@ -0,0 +1,48 @@
{
config,
options,
lib,
...
}:
let
cfg = config.custom.web-services.memos;
dataDir = config.services.memos.settings.MEMOS_DATA;
in
{
options.custom.web-services.memos = {
enable = lib.mkEnableOption "";
domain = lib.mkOption {
type = lib.types.nonEmptyStr;
default = "";
};
port = lib.mkOption {
type = lib.types.port;
default = 5230;
};
doBackups = lib.mkEnableOption "";
};
config = lib.mkIf cfg.enable {
services.memos = {
enable = true;
settings = options.services.memos.settings.default // {
MEMOS_PORT = toString cfg.port;
MEMOS_INSTANCE_URL = "https://${cfg.domain}";
};
};
custom = {
services = {
caddy.virtualHosts.${cfg.domain}.port = cfg.port;
restic.backups.memos = lib.mkIf cfg.doBackups {
conflictingService = "memos.service";
paths = [ dataDir ];
};
};
persistence.directories = [ dataDir ];
};
};
}