2024-08-12 20:14:13 +02:00
|
|
|
{ pkgs, nixpkgs-unstable, ... }:
|
2023-10-10 04:14:29 +02:00
|
|
|
let
|
|
|
|
mastodonNekoversePatches = pkgs.fetchgit {
|
|
|
|
url = "https://github.com/yuri-qq/nekoverse-mastodon-patches.git";
|
2024-10-29 14:47:28 +01:00
|
|
|
hash = "sha256-3jWbKll5RGB1vfEmONVivzGYcoONEkBEHh/rOt9LXlU=";
|
2023-10-10 04:14:29 +02:00
|
|
|
};
|
|
|
|
mastodonNekoverseOverlay = final: prev: {
|
|
|
|
mastodon = (prev.mastodon.override rec {
|
2024-10-29 14:47:28 +01:00
|
|
|
version = "4.3.1";
|
2023-10-10 04:14:29 +02:00
|
|
|
srcOverride = final.applyPatches {
|
|
|
|
src = final.fetchgit {
|
|
|
|
url = "https://github.com/mastodon/mastodon.git";
|
|
|
|
rev = "v${version}";
|
2024-10-29 14:47:28 +01:00
|
|
|
sha256 = "sha256-JlpQGyVPTLcB3RcWMBrmYc1AAUT1JLfS4IDas9ZoWh4=";
|
2023-10-10 04:14:29 +02:00
|
|
|
};
|
|
|
|
patches = [
|
|
|
|
"${mastodonNekoversePatches}/patches/001_increase_image_dimensions_limit.patch"
|
2023-12-16 00:22:59 +01:00
|
|
|
"${mastodonNekoversePatches}/patches/002_disable_image_reprocessing.patch"
|
2023-10-10 04:14:29 +02:00
|
|
|
"${mastodonNekoversePatches}/patches/003_make_toot_cute.patch"
|
2024-10-29 14:47:28 +01:00
|
|
|
"${mastodonNekoversePatches}/patches/004_improve_custom_emoji_support.patch"
|
|
|
|
"${mastodonNekoversePatches}/patches/005_increase_profile_limits.patch"
|
|
|
|
"${mastodonNekoversePatches}/patches/006_increase_toot_character_limit.patch"
|
2023-10-10 04:14:29 +02:00
|
|
|
];
|
|
|
|
};
|
2024-10-29 14:53:58 +01:00
|
|
|
yarnHash = "sha256-e5c04M6XplAgaVyldU5HmYMYtY3MAWs+a8Z/BGSyGBg=";
|
2023-10-10 04:14:29 +02:00
|
|
|
});
|
|
|
|
};
|
2024-08-12 20:14:13 +02:00
|
|
|
pkgs-overlay = nixpkgs-unstable.legacyPackages."x86_64-linux".extend mastodonNekoverseOverlay;
|
2023-11-15 12:18:23 +01:00
|
|
|
vapidPublicKey = pkgs.writeText "vapid-public-key" "BDCbFEDCZ8eFuWr3uEq4Qc30UFZUQeNpF8OCw6OjPwAtaKS1yTM3Ue749Xjqy5WhBDjakzlixh4Gk7gluUhIdsU=";
|
2023-10-10 04:14:29 +02:00
|
|
|
in
|
|
|
|
{
|
|
|
|
services.mastodon = {
|
|
|
|
enable = true;
|
|
|
|
package = pkgs-overlay.mastodon;
|
|
|
|
localDomain = "social.nekover.se";
|
|
|
|
secretKeyBaseFile = "/secrets/mastodon-secret-key-base.secret";
|
|
|
|
otpSecretFile = "/secrets/mastodon-otp-secret.secret";
|
2023-11-15 12:18:23 +01:00
|
|
|
vapidPublicKeyFile = "${vapidPublicKey}";
|
2023-10-10 04:14:29 +02:00
|
|
|
vapidPrivateKeyFile = "/secrets/mastodon-vapid-private-key.secret";
|
|
|
|
smtp = {
|
|
|
|
authenticate = true;
|
|
|
|
host = "mail-1.grzb.de";
|
|
|
|
port = 465;
|
|
|
|
user = "social@nekover.se";
|
|
|
|
passwordFile = "/secrets/mastodon-email-smtp-pass.secret";
|
|
|
|
fromAddress = "Nekoverse <nyareply@nekover.se>";
|
|
|
|
};
|
2023-11-20 23:16:20 +01:00
|
|
|
streamingProcesses = 3;
|
2023-10-10 04:14:29 +02:00
|
|
|
extraConfig = {
|
|
|
|
SMTP_TLS = "true";
|
|
|
|
ES_PRESET = "single_node_cluster";
|
2024-01-19 12:16:42 +01:00
|
|
|
OIDC_CLIENT_ID = "mastodon";
|
|
|
|
OIDC_ENABLED = "true";
|
|
|
|
OMNIAUTH_ONLY = "false";
|
|
|
|
OIDC_DISPLAY_NAME = "Login with Nekoverse ID";
|
|
|
|
OIDC_ISSUER = "https://id.nekover.se/realms/nekoverse";
|
|
|
|
OIDC_DISCOVERY = "true";
|
|
|
|
OIDC_SCOPE = "openid,profile,email";
|
|
|
|
OIDC_UID_FIELD = "preferred_username";
|
|
|
|
OIDC_REDIRECT_URI = "https://social.nekover.se/auth/auth/openid_connect/callback";
|
|
|
|
OIDC_SECURITY_ASSUME_EMAIL_IS_VERIFIED = "true";
|
|
|
|
OIDC_END_SESSION_ENDPOINT = "https://id.nekover.se/realms/nekoverse/protocol/openid-connect/logout";
|
2023-10-10 04:14:29 +02:00
|
|
|
};
|
2024-01-19 12:16:42 +01:00
|
|
|
extraEnvFiles = [
|
|
|
|
"/secrets/mastodon-keycloak-client-secret.secret"
|
|
|
|
];
|
2023-10-10 04:14:29 +02:00
|
|
|
elasticsearch.host = "127.0.0.1";
|
|
|
|
};
|
|
|
|
}
|