mirror of
https://github.com/phfroidmont/self-hosting.git
synced 2025-12-25 21:57:00 +01:00
51 lines
1.2 KiB
Nix
51 lines
1.2 KiB
Nix
|
|
{ config, lib, ... }:
|
||
|
|
with lib;
|
||
|
|
let
|
||
|
|
cfg = config.custom.services.mastodon;
|
||
|
|
in
|
||
|
|
{
|
||
|
|
options.custom.services.mastodon = {
|
||
|
|
enable = mkEnableOption "mastodon";
|
||
|
|
};
|
||
|
|
|
||
|
|
|
||
|
|
config = mkIf cfg.enable {
|
||
|
|
sops.secrets = {
|
||
|
|
mastodonDbPassword = {
|
||
|
|
owner = config.users.users.mastodon.name;
|
||
|
|
key = "mastodon/db_password";
|
||
|
|
restartUnits = [ "mastodon-init-db.service" ];
|
||
|
|
};
|
||
|
|
noreplyFroidmontPassword = {
|
||
|
|
owner = config.users.users.mastodon.name;
|
||
|
|
key = "email/accounts_passwords/noreply_froidmont_clear";
|
||
|
|
};
|
||
|
|
};
|
||
|
|
|
||
|
|
services.mastodon = {
|
||
|
|
enable = true;
|
||
|
|
localDomain = "social.froidmont.org";
|
||
|
|
configureNginx = true;
|
||
|
|
database = {
|
||
|
|
createLocally = false;
|
||
|
|
host = "10.0.1.11";
|
||
|
|
name = "mastodon";
|
||
|
|
user = "mastodon";
|
||
|
|
passwordFile = config.sops.secrets.mastodonDbPassword.path;
|
||
|
|
};
|
||
|
|
smtp = {
|
||
|
|
createLocally = false;
|
||
|
|
authenticate = true;
|
||
|
|
host = "mail.banditlair.com";
|
||
|
|
port = 465;
|
||
|
|
fromAddress = "noreply@froidmont.org";
|
||
|
|
user = "noreply@froidmont.org";
|
||
|
|
passwordFile = config.sops.secrets.noreplyFroidmontPassword.path;
|
||
|
|
};
|
||
|
|
extraConfig = {
|
||
|
|
SMTP_SSL = "true";
|
||
|
|
};
|
||
|
|
};
|
||
|
|
};
|
||
|
|
}
|