summaryrefslogtreecommitdiff
path: root/chaski/services/bahnhof-name.nix
blob: 7360372336863d880ace877f4d1afb1a5d516f98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{ config, lib, pkgs, ... }:

{
  systemd.services.bahnhof-name = {
    enable = true;
    wantedBy = [ "multi-user.target" ];
    serviceConfig.Type = "simple";
    serviceConfig.Restart = "always";
    serviceConfig.MemoryMax = "1G";
    path = [ pkgs.bahnhof-name ];
    script = ''
      cd ${pkgs.bahnhof-name.outPath}
      bin/bahnhof-name
    '';
  };

  services.nginx.virtualHosts =
    let vhost = {
      enableACME = true;
      forceSSL = true;
      locations."/".proxyPass = "http://localhost:8080";
    }; in builtins.listToAttrs
    (map (name: { inherit name; value = vhost; })
      ["bahnhof.name" "ril100.bahnhof.name"
       "ds100.bahnhof.name" "leitpunkt.bahnhof.name"]);
}