summaryrefslogtreecommitdiff
path: root/hosts/chaski/services/gtfs.nix
diff options
context:
space:
mode:
authorstuebinm2021-10-03 03:13:05 +0200
committerstuebinm2021-10-03 03:13:23 +0200
commit22c6837abde39c5a75baeefa95908792867e42de (patch)
tree00566d70fd0b4dcd0e773177d850129f479a0bb2 /hosts/chaski/services/gtfs.nix
parentee21f53dea4f8e069bb8a97d808b9cf1f030a910 (diff)
add gtfs validator as a service
This just runs the GTFS validator as a web service, since it's a horrible piece of python2 stuff which I don't want to set up every time I used it (nor except other people to do so if they need it).
Diffstat (limited to 'hosts/chaski/services/gtfs.nix')
-rw-r--r--hosts/chaski/services/gtfs.nix38
1 files changed, 38 insertions, 0 deletions
diff --git a/hosts/chaski/services/gtfs.nix b/hosts/chaski/services/gtfs.nix
new file mode 100644
index 0000000..61837a1
--- /dev/null
+++ b/hosts/chaski/services/gtfs.nix
@@ -0,0 +1,38 @@
+{ config, lib, pkgs, ... }:
+
+let
+ vaas = import ./VaaS/default.nix {inherit pkgs; };
+
+ transitfeed = pkgs.fetchFromGitHub {
+ owner = "google";
+ repo = "transitfeed";
+ rev = "d727e97cb66ac2ca2d699a382ea1d449ee26c2a1";
+ sha256 = "0kmcmdja6h7gzvi40c9qfzxh6qwv5184g2rgpqx5rhj4ql9ini3h";
+ };
+
+ index = pkgs.copyPathToStore ./VaaS/index.html;
+in
+{
+ systemd.services.vaas = {
+ enable = true;
+ wantedBy = [ "multi-user.target" ];
+ after = [ "network.target" ];
+ description = "GTFS feed validator as a service";
+ path = [ pkgs.python2 pkgs.python2Packages.pytz pkgs.python2Packages.enum34 ];
+ serviceConfig = {
+ ExecStart = "${vaas}/bin/VaaS ${transitfeed}/feedvalidator.py ${index}";
+ Restart = "always";
+ PrivateTmp = "true";
+ PrivateDevices = "true";
+ ProtectSystem = "strict";
+ ReadWritePaths = [ "/tmp" ];
+ };
+
+ };
+
+ services.nginx.virtualHosts."gtfs.stuebinm.eu" = {
+ enableACME = true;
+ forceSSL = true;
+ locations."/".proxyPass = "http://localhost:7000";
+ };
+}