stirling-pdf service
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
modules = {
|
modules = {
|
||||||
pocket-id = ../modules/clan/pocket-id;
|
pocket-id = ../modules/clan/pocket-id;
|
||||||
nextcloud = ../modules/clan/nextcloud;
|
nextcloud = ../modules/clan/nextcloud;
|
||||||
|
stirling-pdf = ../modules/clan/stirling-pdf;
|
||||||
};
|
};
|
||||||
inventory = {
|
inventory = {
|
||||||
|
|
||||||
@@ -30,6 +31,13 @@
|
|||||||
roles.default.machines.b4l = { };
|
roles.default.machines.b4l = { };
|
||||||
|
|
||||||
};
|
};
|
||||||
|
stirling-pdf = {
|
||||||
|
module = {
|
||||||
|
name = "stirling-pdf";
|
||||||
|
input = "self";
|
||||||
|
};
|
||||||
|
roles.default.machines.b4l = { };
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
|
|||||||
48
modules/clan/stirling-pdf/default.nix
Normal file
48
modules/clan/stirling-pdf/default.nix
Normal 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}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user