snix/ops/modules/atward.nix
Vincent Ambo 790c0d938e feat(ops): Add NixOS module for atward
Very standard, nothing fancy.

Change-Id: Ibb286f221a4752abfb62e971b98e9496357040f5
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3090
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
2021-05-03 23:47:30 +00:00

31 lines
716 B
Nix

{ depot, config, lib, pkgs, ... }:
let
cfg = config.services.depot.atward;
description = "atward - (attempt to) cleverly route queries";
in {
options.services.depot.atward = {
enable = lib.mkEnableOption description;
port = lib.mkOption {
type = lib.types.int;
default = 28973;
description = "Port on which atward should listen";
};
};
config = lib.mkIf cfg.enable {
systemd.services.atward = {
inherit description;
script = "${depot.web.atward}/bin/atward";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
DynamicUser = true;
Restart = "always";
};
environment.ATWARD_PORT = toString cfg.port;
};
};
}