summaryrefslogtreecommitdiff
path: root/chaski/services/tracktrain.nix
diff options
context:
space:
mode:
authorstuebinm2022-06-10 21:56:50 +0200
committerstuebinm2022-06-11 00:34:12 +0200
commit0c3e2c500d181c673f0563e6f5bee49729f49b73 (patch)
treee420fc94017be9f74b80e11efaab4555ff2f57d2 /chaski/services/tracktrain.nix
parentb7f43b7b41770016b82faca4fc918c5ec60791df (diff)
add tracktrain test deployment
Diffstat (limited to '')
-rw-r--r--chaski/services/tracktrain.nix30
1 files changed, 30 insertions, 0 deletions
diff --git a/chaski/services/tracktrain.nix b/chaski/services/tracktrain.nix
new file mode 100644
index 0000000..6f9acb9
--- /dev/null
+++ b/chaski/services/tracktrain.nix
@@ -0,0 +1,30 @@
+{ config, lib, pkgs, inputs, ... }:
+
+{
+ services.nginx.virtualHosts."tracktrain.stuebinm.eu" = {
+ locations."/" = {
+ proxyPass = "http://localhost:4000";
+ proxyWebsockets = true;
+ };
+ enableACME = true;
+ forceSSL = true;
+ };
+
+ networking.firewall.allowedTCPPorts = [ 443 ];
+
+ systemd.services.tracktrain = {
+ enable = true;
+
+ description = "tracks trains, hopefully";
+ wantedBy = [ "multi-user.target" ];
+ after = [ "network.target" ];
+ serviceConfig.Type = "simple";
+ path = [ pkgs.wget ];
+ script = ''
+ cd /tmp
+ wget "https://ilztalbahn.eu/wp-content/uploads/2020/07/gtfs.zip"
+ ${import inputs.tracktrain {nixpkgs = pkgs;}}/bin/haskell-gtfs
+ '';
+ startAt = "daily";
+ };
+}