summaryrefslogtreecommitdiff
path: root/config/linoquotes.nix
blob: 6f964897e2437380f2628277b4ff25ba16d3100e (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
{ configs, lib, pkgs, ... }:
let
  port = (import ../data/aliases.nix).services.linoquotes.port;
  linoquotes-gamma = pkgs.callPackage /opt/linoquotes-gamma/default.nix {};
in
{
  # My hydra isn't working at the moment.
  # imports = [ ./orbekk-pkgs.nix ];

  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";
    };
  };
}