rework stirling-pdf to be more generic with test
This commit is contained in:
26
machines/b4l/services/stirling-pdf.nix
Normal file
26
machines/b4l/services/stirling-pdf.nix
Normal file
@@ -0,0 +1,26 @@
|
||||
{ config, ... }:
|
||||
let
|
||||
stDomain = "${config.clan.core.vars.generators.b4l-stirling-pdf.files.subdomain.value}.${config.networking.fqdn}";
|
||||
in
|
||||
{
|
||||
clan.core.vars.generators.b4l-stirling-pdf = {
|
||||
files.subdomain.secret = false;
|
||||
|
||||
prompts = {
|
||||
subdomain = {
|
||||
persist = true;
|
||||
type = "line";
|
||||
description = "Sub-domain for Stirling PDF app. Default:(pdf)";
|
||||
};
|
||||
};
|
||||
script = ''cat $prompts/subdomain || echo -n "pdf" > $out/subdomain'';
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."${stDomain}" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "${config.networking.fqdn}";
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:${builtins.toString config.services.stirling-pdf.environment.SERVER_PORT}";
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user