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 +++++++++++++++++++++++++++++++ flake.lock | 18 ++++++++++++++++++ flake.nix | 3 +++ 4 files changed, 53 insertions(+) create mode 100644 chaski/services/22f3.nix 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; + ''; + }; + }; +} diff --git a/flake.lock b/flake.lock index ea01c03..76b60be 100644 --- a/flake.lock +++ b/flake.lock @@ -133,6 +133,23 @@ "type": "github" } }, + "freiraum": { + "flake": false, + "locked": { + "lastModified": 1671478879, + "narHash": "sha256-HmXTIFe9xj6wPpr3MeyGAO/XUdyVvAzxFlLwU4s3850=", + "ref": "network", + "rev": "014d5fa10e15e3a2746d2316fc2e0bdb50e12aee", + "revCount": 2, + "type": "git", + "url": "https://git.infra4future.de/stuebinm/22f3-roomplans" + }, + "original": { + "ref": "network", + "type": "git", + "url": "https://git.infra4future.de/stuebinm/22f3-roomplans" + } + }, "gtfsBooks": { "flake": false, "locked": { @@ -290,6 +307,7 @@ "deploy-rs": "deploy-rs", "emacs-overlay": "emacs-overlay", "feeds": "feeds", + "freiraum": "freiraum", "gtfsBooks": "gtfsBooks", "home-manager": "home-manager", "naersk": "naersk", diff --git a/flake.nix b/flake.nix index 3325779..d5b28de 100644 --- a/flake.nix +++ b/flake.nix @@ -38,6 +38,9 @@ gtfsBooks.flake = false; walint.url = "git+https://stuebinm.eu/git/walint?ref=playground"; walint.flake = false; + + freiraum.url = "git+https://git.infra4future.de/stuebinm/22f3-roomplans?ref=network"; + freiraum.flake = false; }; outputs = { self, nixpkgs, deploy-rs, ... }@inputs: -- cgit v1.2.3