masive rewriting and setup of server files
This commit is contained in:
@@ -2,20 +2,22 @@
|
||||
lib,
|
||||
config,
|
||||
proxyReverse,
|
||||
setup,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.my.servers.microbin;
|
||||
in
|
||||
{
|
||||
options.my.servers.microbin = {
|
||||
enable = lib.mkEnableOption "enable";
|
||||
enableCron = lib.mkEnableOption "enable";
|
||||
};
|
||||
options.my.servers.microbin = setup.mkOptions "microbin" "copy" 8080;
|
||||
config = lib.mkIf config.my.servers.microbin.enable {
|
||||
networking.firewall.allowedTCPPorts = lib.mkIf (!cfg.isLocal) [ cfg.port ];
|
||||
services = {
|
||||
microbin = {
|
||||
microbin = lib.mkIf cfg.enable {
|
||||
enable = true;
|
||||
settings = {
|
||||
MICROBIN_PORT = cfg.port;
|
||||
MICROBIN_HIDE_LOGO = false;
|
||||
MICROBIN_PORT = 8080;
|
||||
MICROBIN_HIGHLIGHTSYNTAX = true;
|
||||
MICROBIN_PRIVATE = true;
|
||||
MICROBIN_QR = true;
|
||||
@@ -23,8 +25,9 @@
|
||||
MICROBIN_ENCRYPTION_SERVER_SIDE = true;
|
||||
};
|
||||
};
|
||||
nginx.virtualHosts."copy.${config.my.domain}" =
|
||||
proxyReverse config.services.microbin.settings.MICROBIN_PORT // { };
|
||||
nginx.virtualHosts."${cfg.host}" = lib.mkIf cfg.enableProxy (
|
||||
proxyReverse cfg.hostName cfg.port // { }
|
||||
);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user