summaryrefslogtreecommitdiff
path: root/chaski/services/bahnhof-name.nix
blob: d11f7ec70dbc94a843f4292f72f3cc834fb68a4c (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/bahnhofname
    '';
  };

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