puter/hosts/headless/abacus/microbin.nix

51 lines
1.3 KiB
Nix
Raw Normal View History

2025-03-23 21:48:46 +00:00
# TODO: use another service for this
2024-09-15 12:16:32 +00:00
{
config,
lib,
...
}: let
2024-08-18 00:55:37 +00:00
inherit (config.networking) domain;
virtualHostName = "bin.${domain}";
in {
2024-12-01 03:05:16 +00:00
age.secrets = lib.mkSecrets {microbin = {};};
2024-08-18 00:55:37 +00:00
services.microbin = {
enable = true;
passwordFile = config.age.secrets.microbin.path;
settings = {
2024-09-15 12:26:34 +00:00
MICROBIN_BIND = "127.0.0.1";
2024-08-18 00:55:37 +00:00
MICROBIN_PORT = 8020;
2024-10-31 23:40:42 +00:00
MICROBIN_PUBLIC_PATH = "https://${virtualHostName}/";
2024-08-21 21:35:55 +00:00
MICROBIN_READONLY = true;
2024-10-31 23:40:42 +00:00
MICROBIN_EDITABLE = true;
MICROBIN_ETERNAL_PASTA = true;
MICROBIN_HIGHLIGHTSYNTAX = true;
MICROBIN_PRIVATE = true;
2024-12-01 03:05:16 +00:00
MICROBIN_ENABLE_BURN_AFTER = true;
2024-08-18 00:55:37 +00:00
MICROBIN_QR = true;
2024-12-01 03:05:16 +00:00
MICROBIN_NO_FILE_UPLOAD = false;
MICROBIN_ENCRYPTION_CLIENT_SIDE = true;
2024-08-18 00:55:37 +00:00
MICROBIN_MAX_FILE_SIZE_ENCRYPTED_MB = 1024;
MICROBIN_MAX_FILE_SIZE_UNENCRYPTED_MB = 4096;
2024-10-31 23:40:42 +00:00
MICROBIN_DISABLE_UPDATE_CHECKING = true;
2024-08-18 00:55:37 +00:00
MICROBIN_DISABLE_TELEMETRY = true;
MICROBIN_LIST_SERVER = false;
};
};
services.nginx.virtualHosts.${virtualHostName} = {
enableACME = true;
forceSSL = true;
2025-03-23 21:48:46 +00:00
locations."/".proxyPass = let
2024-09-15 12:16:32 +00:00
host = config.services.microbin.settings.MICROBIN_BIND;
2025-03-23 21:48:46 +00:00
port = builtins.toString config.services.microbin.settings.MICROBIN_PORT;
in "http://${host}:${port}";
2024-08-18 00:55:37 +00:00
};
}