2016-10-02 21:41:48 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.services.opentracker;
|
|
|
|
in {
|
|
|
|
options.services.opentracker = {
|
2022-08-28 19:18:44 +00:00
|
|
|
enable = mkEnableOption (lib.mdDoc "opentracker");
|
2016-10-02 21:41:48 +00:00
|
|
|
|
|
|
|
package = mkOption {
|
|
|
|
type = types.package;
|
2022-07-28 21:19:15 +00:00
|
|
|
description = lib.mdDoc ''
|
2016-10-02 21:41:48 +00:00
|
|
|
opentracker package to use
|
|
|
|
'';
|
|
|
|
default = pkgs.opentracker;
|
2021-10-03 16:06:03 +00:00
|
|
|
defaultText = literalExpression "pkgs.opentracker";
|
2016-10-02 21:41:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extraOptions = mkOption {
|
|
|
|
type = types.separatedString " ";
|
2022-07-28 21:19:15 +00:00
|
|
|
description = lib.mdDoc ''
|
2016-10-02 21:41:48 +00:00
|
|
|
Configuration Arguments for opentracker
|
|
|
|
See https://erdgeist.org/arts/software/opentracker/ for all params
|
|
|
|
'';
|
|
|
|
default = "";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
|
|
|
|
systemd.services.opentracker = {
|
|
|
|
description = "opentracker server";
|
|
|
|
after = [ "network.target" ];
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
restartIfChanged = true;
|
|
|
|
serviceConfig = {
|
|
|
|
ExecStart = "${cfg.package}/bin/opentracker ${cfg.extraOptions}";
|
|
|
|
PrivateTmp = true;
|
|
|
|
WorkingDirectory = "/var/empty";
|
|
|
|
# By default opentracker drops all privileges and runs in chroot after starting up as root.
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|