forked from aylac.top/nixcfg
this repo has no description

privatebin

aylac.top 4823293c 6703b9c6

verified
Changed files
+67
hosts
nanpi
modules
nixos
services
snippets
aylac-top
+1
hosts/nanpi/default.nix
···
miniflux.enable = true;
ntfy.enable = true;
pds.enable = true;
+
privatebin.enable = true;
qbittorrent = {
enable = true;
webuiPort = config.mySnippets.tailnet.networkMap.qbittorrent.port;
+1
modules/nixos/services/default.nix
···
./ntfy
./pds
./postgresql
+
./privatebin
./qbittorrent
./radicale
./redlib
+59
modules/nixos/services/privatebin/default.nix
···
+
{
+
config,
+
lib,
+
...
+
}: let
+
name = "privatebin";
+
cfg = config.myNixOS.services.${name};
+
+
network = config.mySnippets.aylac-top;
+
service = network.networkMap.${name};
+
in {
+
options.myNixOS.services.${name} = {
+
enable = lib.mkEnableOption "${name} server";
+
autoProxy = lib.mkOption {
+
default = true;
+
example = false;
+
description = "${name} auto proxy";
+
type = lib.types.bool;
+
};
+
};
+
+
config = lib.mkIf cfg.enable {
+
services = {
+
cloudflared.tunnels."${network.cloudflareTunnel}".ingress = lib.mkIf cfg.autoProxy {
+
"${service.vHost}" = "http://localhost:${toString service.port}";
+
};
+
+
nginx.virtualHosts."${config.services.privatebin.virtualHost}".listen = [
+
{
+
addr = "localhost";
+
inherit (service) port;
+
}
+
];
+
+
privatebin = {
+
enable = true;
+
enableNginx = true;
+
settings = {
+
main = {
+
name = "ayla's trashbin";
+
basepath = "https://${service.vHost}/";
+
discussion = true;
+
opendiscussion = false;
+
discussiondatedisplay = true;
+
password = true;
+
fileupload = true;
+
burnafterreadingselected = false;
+
defaultformatter = "syntaxhighlighting";
+
syntaxhighlightingtheme = "sons-of-obsidian";
+
qrcode = true;
+
template = "bootstrap5";
+
};
+
model.class = "Filesystem";
+
model_options.dir = "/var/lib/privatebin/data";
+
};
+
};
+
};
+
};
+
}
+6
modules/snippets/aylac-top/default.nix
···
port = 5555;
vHost = "knot.aylac.top";
};
+
+
privatebin = {
+
hostName = "nanpi";
+
port = 7748;
+
vHost = "bin.aylac.top";
+
};
};
};
};