stirling-pdf service

This commit is contained in:
2025-07-16 16:06:37 +07:00
parent c716a79703
commit 528ef9ab77
2 changed files with 56 additions and 0 deletions

View File

@@ -10,6 +10,7 @@
modules = {
pocket-id = ../modules/clan/pocket-id;
nextcloud = ../modules/clan/nextcloud;
stirling-pdf = ../modules/clan/stirling-pdf;
};
inventory = {
@@ -30,6 +31,13 @@
roles.default.machines.b4l = { };
};
stirling-pdf = {
module = {
name = "stirling-pdf";
input = "self";
};
roles.default.machines.b4l = { };
};
};
services = {

View File

@@ -0,0 +1,48 @@
{ lib, ... }:
{
_class = "clan.service";
manifest.name = "stirling-pdf";
manifest.description = "Your locally hosted one-stop-shop for all your PDF needs.";
manifest.categories = [ "System" ];
roles.default = {
interface.options = {
domain = lib.mkOption {
type = lib.types.str;
default = "pdf";
description = "Sub domain or Stirling PDF service";
};
};
perInstance =
{
settings,
...
}:
{
nixosModule =
{
config,
...
}:
let
domain = "${settings.domain}.${config.networking.fqdn}";
in
{
services.stirling-pdf = {
enable = true;
environment = {
SERVER_PORT = 8080;
};
};
services.nginx.virtualHosts."${domain}" = {
forceSSL = true;
useACMEHost = "${config.networking.fqdn}";
locations."/" = {
proxyPass = "http://localhost:${builtins.toString config.services.stirling-pdf.environment.SERVER_PORT}";
};
};
};
};
};
}