nix/package/privatebin/Config.nix

55 lines
1.1 KiB
Nix
Raw Normal View History

{
2024-11-04 04:37:29 +03:00
config,
pkgs,
lib,
2024-11-04 04:37:29 +03:00
util,
...
2024-11-06 12:56:58 +03:00
}: let
cfg = {
2024-11-04 04:37:29 +03:00
main = {
compression = "none";
defaultformatter = "plaintext";
discussion = false;
email = true;
fileupload = false;
languageselection = false;
name = "voronind pastebin";
password = true;
qrcode = true;
sizelimit = 10 * 1000 * 1000;
2024-11-06 12:56:58 +03:00
template = "bootstrap";
2024-11-04 04:37:29 +03:00
};
expire = {
default = "1week";
};
formatter_options = {
markdown = "Markdown";
plaintext = "Plain Text";
syntaxhighlighting = "Source Code";
};
traffic = {
limit = 10;
};
purge = {
limit = 0;
batchsize = 10;
};
model = {
class = "Database";
};
model_options = {
"opt[12]" = true;
2024-12-02 21:12:45 +03:00
dsn = "pgsql:dbname=privatebin";
2024-11-04 04:37:29 +03:00
pwd = "privatebin";
tbl = "privatebin_";
usr = "privatebin";
};
};
2024-11-06 12:56:58 +03:00
in {
file = (pkgs.formats.ini {
mkKeyValue = with lib.generators; mkKeyValueDefault {
mkValueString = v: if builtins.isString v then "\"${toString v}\"" else toString v;
} " = ";
}).generate "PrivateBinConfig" cfg;
}