···
description = "Enable tangled appview";
description = "Package to use for the appview";
description = "Port to run the appview on";
+
listenAddr = mkOption {
+
default = "0.0.0.0:${toString cfg.port}";
+
description = "Listen address for the appview service";
+
default = "/var/lib/appview/appview.db";
+
description = "Path to the SQLite database file";
+
appviewHost = mkOption {
+
default = "https://tangled.org";
+
example = "https://example.com";
+
description = "Public host URL for the appview instance";
+
appviewName = mkOption {
+
description = "Display name for the appview instance";
+
description = "Enable development mode";
+
disallowedNicknamesFile = mkOption {
+
type = types.nullOr types.path;
+
description = "Path to file containing disallowed nicknames";
+
default = "localhost:6379";
+
description = "Redis server address";
+
description = "Redis database number";
+
# jetstream configuration
+
default = "wss://jetstream1.us-east.bsky.network/subscribe";
+
description = "Jetstream WebSocket endpoint";
+
# knotstream consumer configuration
+
retryInterval = mkOption {
+
description = "Initial retry interval for knotstream consumer";
+
maxRetryInterval = mkOption {
+
description = "Maximum retry interval for knotstream consumer";
+
connectionTimeout = mkOption {
+
description = "Connection timeout for knotstream consumer";
+
workerCount = mkOption {
+
description = "Number of workers for knotstream consumer";
+
description = "Queue size for knotstream consumer";
+
# spindlestream consumer configuration
+
retryInterval = mkOption {
+
description = "Initial retry interval for spindlestream consumer";
+
maxRetryInterval = mkOption {
+
description = "Maximum retry interval for spindlestream consumer";
+
connectionTimeout = mkOption {
+
description = "Connection timeout for spindlestream consumer";
+
workerCount = mkOption {
+
description = "Number of workers for spindlestream consumer";
+
description = "Queue size for spindlestream consumer";
+
default = "noreply@notifs.tangled.sh";
+
description = "Email address to send notifications from";
+
# posthog configuration
+
default = "https://eu.i.posthog.com";
+
description = "PostHog API endpoint";
+
default = "https://camo.tangled.sh";
+
description = "Camo proxy host URL";
+
default = "https://avatar.tangled.sh";
+
description = "Avatar service host URL";
+
default = "https://plc.directory";
+
description = "PLC directory URL";
+
default = "https://tngl.sh";
+
description = "PDS host URL";
+
type = types.listOf types.str;
+
"at://did:plc:wshs7t2adsemcrrd4snkeqli/sh.tangled.label.definition/wontfix"
+
"at://did:plc:wshs7t2adsemcrrd4snkeqli/sh.tangled.label.definition/good-first-issue"
+
"at://did:plc:wshs7t2adsemcrrd4snkeqli/sh.tangled.label.definition/duplicate"
+
"at://did:plc:wshs7t2adsemcrrd4snkeqli/sh.tangled.label.definition/documentation"
+
"at://did:plc:wshs7t2adsemcrrd4snkeqli/sh.tangled.label.definition/assignee"
+
description = "Default label definitions";
+
goodFirstIssue = mkOption {
+
default = "at://did:plc:wshs7t2adsemcrrd4snkeqli/sh.tangled.label.definition/good-first-issue";
+
description = "Good first issue label definition";
environmentFile = mkOption {
type = with types; nullOr path;
+
example = "/etc/appview.env";
Additional environment file as defined in {manpage}`systemd.exec(5)`.
+
Sensitive secrets such as {env}`TANGLED_COOKIE_SECRET`,
+
{env}`TANGLED_OAUTH_CLIENT_SECRET`, {env}`TANGLED_RESEND_API_KEY`,
+
{env}`TANGLED_CAMO_SHARED_SECRET`, {env}`TANGLED_AVATAR_SHARED_SECRET`,
+
{env}`TANGLED_REDIS_PASS`, {env}`TANGLED_PDS_ADMIN_SECRET`,
+
{env}`TANGLED_CLOUDFLARE_API_TOKEN`, {env}`TANGLED_CLOUDFLARE_ZONE_ID`,
+
{env}`TANGLED_CLOUDFLARE_TURNSTILE_SITE_KEY`,
+
{env}`TANGLED_CLOUDFLARE_TURNSTILE_SECRET_KEY`,
+
{env}`TANGLED_POSTHOG_API_KEY`, {env}`TANGLED_APP_PASSWORD`,
+
and {env}`TANGLED_ALT_APP_PASSWORD` may be passed to the service
+
without making them world readable in the nix store.
···
systemd.services.appview = {
description = "tangled appview service";
wantedBy = ["multi-user.target"];
+
after = ["redis-appview.service" "network-online.target"];
requires = ["redis-appview.service"];
+
wants = ["network-online.target"];
ExecStart = "${cfg.package}/bin/appview";
+
EnvironmentFile = mkIf (cfg.environmentFile != null) cfg.environmentFile;
+
StateDirectory = "appview";
+
WorkingDirectory = "/var/lib/appview";
+
NoNewPrivileges = true;
+
ProtectSystem = "strict";
+
ReadWritePaths = ["/var/lib/appview"];
+
TANGLED_DB_PATH = cfg.dbPath;
+
TANGLED_LISTEN_ADDR = cfg.listenAddr;
+
TANGLED_APPVIEW_HOST = cfg.appviewHost;
+
TANGLED_APPVIEW_NAME = cfg.appviewName;
+
// optionalAttrs (cfg.disallowedNicknamesFile != null) {
+
TANGLED_DISALLOWED_NICKNAMES_FILE = cfg.disallowedNicknamesFile;
+
TANGLED_REDIS_ADDR = cfg.redis.addr;
+
TANGLED_REDIS_DB = toString cfg.redis.db;
+
TANGLED_JETSTREAM_ENDPOINT = cfg.jetstream.endpoint;
+
TANGLED_KNOTSTREAM_RETRY_INTERVAL = cfg.knotstream.retryInterval;
+
TANGLED_KNOTSTREAM_MAX_RETRY_INTERVAL = cfg.knotstream.maxRetryInterval;
+
TANGLED_KNOTSTREAM_CONNECTION_TIMEOUT = cfg.knotstream.connectionTimeout;
+
TANGLED_KNOTSTREAM_WORKER_COUNT = toString cfg.knotstream.workerCount;
+
TANGLED_KNOTSTREAM_QUEUE_SIZE = toString cfg.knotstream.queueSize;
+
TANGLED_SPINDLESTREAM_RETRY_INTERVAL = cfg.spindlestream.retryInterval;
+
TANGLED_SPINDLESTREAM_MAX_RETRY_INTERVAL = cfg.spindlestream.maxRetryInterval;
+
TANGLED_SPINDLESTREAM_CONNECTION_TIMEOUT = cfg.spindlestream.connectionTimeout;
+
TANGLED_SPINDLESTREAM_WORKER_COUNT = toString cfg.spindlestream.workerCount;
+
TANGLED_SPINDLESTREAM_QUEUE_SIZE = toString cfg.spindlestream.queueSize;
+
TANGLED_RESEND_SENT_FROM = cfg.resend.sentFrom;
+
TANGLED_POSTHOG_ENDPOINT = cfg.posthog.endpoint;
+
TANGLED_CAMO_HOST = cfg.camo.host;
+
TANGLED_AVATAR_HOST = cfg.avatar.host;
+
TANGLED_PLC_URL = cfg.plc.url;
+
TANGLED_PDS_HOST = cfg.pds.host;
+
TANGLED_LABEL_DEFAULTS = concatStringsSep "," cfg.label.defaults;
+
TANGLED_LABEL_GFI = cfg.label.goodFirstIssue;