summaryrefslogtreecommitdiff
path: root/config/linoquotes.nix
blob: b5909abccf500c2fce5c1b274893708bc60494a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{ configs, lib, pkgs, ... }:
let
  port = (import ../data/aliases.nix).services.linoquotes.port;
  linoquotes-gamma = pkgs.callPackage /opt/linoquotes-gamma/default.nix { };
in {
  networking.firewall.allowedTCPPorts = [ port ];

  systemd.services.linoquotes = {
    description = "Quote application";
    after = [ "networking.target" ];
    wantedBy = [ "multi-user.target" ];
    environment = {
      RUST_BACKTRACE = "1";
      RUST_LOG = "error,main=info,logger=info,iron=info,linoquotes-gamma=info";
    };
    serviceConfig = {
      ExecStart =
        "${linoquotes-gamma}/bin/linoquotes-gamma --port ${toString port} "
        + "--db_file /var/lib/linoquotes/db.sqlite";
      User = "linoquotes";
    };
  };
}