From a0af2f08b2b21a13a871730686f25263d902ea4b Mon Sep 17 00:00:00 2001 From: korenstin Date: Sat, 7 Dec 2024 17:24:52 +0100 Subject: [PATCH] configuration de stirling-pdf --- flake.nix | 1 + hosts/vm/livre/default.nix | 12 +++++++++++- modules/services/stirling.nix | 14 ++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 modules/services/stirling.nix diff --git a/flake.nix b/flake.nix index 7a8ab67..58da36d 100644 --- a/flake.nix +++ b/flake.nix @@ -37,6 +37,7 @@ apprentix = nixosSystem { specialArgs = inputs; modules = [ ./hosts/vm/apprentix ]; + }; livre = nixosSystem { specialArgs = inputs; diff --git a/hosts/vm/livre/default.nix b/hosts/vm/livre/default.nix index 7ca14c1..19e40b1 100644 --- a/hosts/vm/livre/default.nix +++ b/hosts/vm/livre/default.nix @@ -1,4 +1,4 @@ -{ ... }: +{ config, ... }: { imports = [ @@ -6,10 +6,20 @@ ./networking.nix ../../../modules + ../../../modules/services/nginx.nix + ../../../modules/services/stirling.nix ]; networking.hostName = "livre"; boot.loader.grub.devices = [ "/dev/sda" ]; + services.nginx.virtualHosts = { + "pdf.crans.org" = { + locations."/" = { + proxyPass = "http://localhost:${toString config.services.stirling-pdf.environment.SERVER_PORT}"; + }; + }; + }; + system.stateVersion = "24.11"; } diff --git a/modules/services/stirling.nix b/modules/services/stirling.nix new file mode 100644 index 0000000..85bb52d --- /dev/null +++ b/modules/services/stirling.nix @@ -0,0 +1,14 @@ +{ config, ... }: + +{ + services.stirling-pdf = { + enable = true; + environment = { + csrfDisabled = "false"; + ENDPOINTS_TOREMOVE = "url-to-pdf"; + INSTALL_BOOK_AND_ADVANCED_HTML_OPS = "true"; + SERVER_PORT = 8000; + SYSTEM_DEFAULTLOCALE = "fr-FR"; + }; + }; +}