From 06a24c5eca87eb6c13c45655f17b568fc7f1012d Mon Sep 17 00:00:00 2001 From: stuebinm Date: Mon, 19 Dec 2022 21:08:51 +0100 Subject: chaski: serve 22f3 room plans --- chaski/configuration.nix | 1 + chaski/services/22f3.nix | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 chaski/services/22f3.nix (limited to 'chaski') diff --git a/chaski/configuration.nix b/chaski/configuration.nix index 3618572..c2f8cc6 100644 --- a/chaski/configuration.nix +++ b/chaski/configuration.nix @@ -10,6 +10,7 @@ ./hardware-configuration.nix ./services/uplcg.nix ./services/tracktrain.nix + ./services/22f3.nix ]; networking.firewall.allowedTCPPorts = [ 80 443 ]; diff --git a/chaski/services/22f3.nix b/chaski/services/22f3.nix new file mode 100644 index 0000000..877966c --- /dev/null +++ b/chaski/services/22f3.nix @@ -0,0 +1,31 @@ +{ config, lib, pkgs, inputs, ... }: + +let + roomplans = pkgs.stdenv.mkDerivation { + name = "22f3-roomplans"; + src = inputs.freiraum; + buildInputs = with pkgs; [ poppler_utils inkscape gauche ]; + buildPhase = '' + cp $src/* . + gosh ./generate.scm + ''; + installPhase = '' + mkdir -p $out; + cp out/combined.pdf $out/raumplan.pdf + cp svg/* $out + ''; + }; +in + +{ + services.nginx.virtualHosts."22f3.stuebinm.eu" = { + enableACME = true; + forceSSL = true; + locations."/" = { + root = roomplans.outPath; + extraConfig = '' + autoindex on; + ''; + }; + }; +} -- cgit v1.2.3