2024-05-09 16:08:29 +02:00
|
|
|
{ config, lib, ... }:
|
2024-05-09 15:20:03 +02:00
|
|
|
let port = 8418;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
imports = [ ./cloudflared.nix ];
|
|
|
|
|
|
|
|
sops.secrets.microbin_env.sopsFile = ../secrets.yaml;
|
|
|
|
services.cloudflared.tunnels =
|
|
|
|
config.satellite.cloudflared.proxy "bin.moonythm.dev" port;
|
|
|
|
|
|
|
|
services.microbin = {
|
|
|
|
enable = true;
|
2024-05-09 16:08:29 +02:00
|
|
|
dataDir = "/var/lib/microbin";
|
2024-05-09 16:42:11 +02:00
|
|
|
passwordFile = config.sops.secrets.microbin_env.path;
|
2024-05-09 15:29:18 +02:00
|
|
|
|
|
|
|
# {{{ Settings
|
2024-05-09 15:20:03 +02:00
|
|
|
settings = {
|
|
|
|
# High level settings
|
|
|
|
MICROBIN_ADMIN_USERNAME = "prescientmoon";
|
|
|
|
MICROBIN_PORT = toString port;
|
2024-05-09 17:07:54 +02:00
|
|
|
MICROBIN_PUBLIC_PATH = "https://bin.moonythm.dev/";
|
2024-05-09 15:20:03 +02:00
|
|
|
MICROBIN_DISABLE_TELEMETRY = "true";
|
2024-05-09 17:07:54 +02:00
|
|
|
MICROBIN_DISABLE_UPDATE_CHECKING = "true";
|
2024-05-09 15:20:03 +02:00
|
|
|
|
|
|
|
# Toggle certain features
|
|
|
|
MICROBIN_READONLY = "true"; # Requires a password to upload
|
|
|
|
MICROBIN_QR = "true"; # Allows generating qr codes
|
2024-05-09 17:07:54 +02:00
|
|
|
MICROBIN_EDITABLE = "true";
|
|
|
|
MICROBIN_HIGHLIGHTSYNTAX = "true";
|
|
|
|
MICROBIN_SHOW_READ_STATS = "true";
|
|
|
|
MICROBIN_ENABLE_BURN_AFTER = "true";
|
|
|
|
MICROBIN_ENABLE_READONLY = "true";
|
|
|
|
MICROBIN_ETERNAL_PASTA = "true";
|
2024-05-09 15:20:03 +02:00
|
|
|
|
|
|
|
# Make UI more minimal
|
2024-05-09 16:56:50 +02:00
|
|
|
# MICROBIN_HIDE_FOOTER = "true";
|
|
|
|
# MICROBIN_HIDE_HEADER = "true";
|
|
|
|
# MICROBIN_HIDE_LOGO = "true";
|
2024-05-09 15:20:03 +02:00
|
|
|
};
|
2024-05-09 15:29:18 +02:00
|
|
|
# }}}
|
2024-05-09 15:20:03 +02:00
|
|
|
};
|
2024-05-09 15:29:18 +02:00
|
|
|
|
2024-05-09 16:08:29 +02:00
|
|
|
systemd.services.microbin.serviceConfig = {
|
|
|
|
# We want to use systemd's `StateDirectory` mechanism to fix permissions
|
|
|
|
ReadWritePaths = lib.mkForce [ ];
|
|
|
|
};
|
|
|
|
|
2024-05-09 16:25:42 +02:00
|
|
|
environment.persistence."/persist/state".directories = [ "/var/lib/private/microbin" ];
|
2024-05-09 15:20:03 +02:00
|
|
|
}
|