nixpkgs/nixos/modules/services/torrent/opentracker.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
990 B
Nix
Raw Normal View History

2016-10-02 21:41:48 +00:00
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.opentracker;
in {
options.services.opentracker = {
enable = mkEnableOption "opentracker";
2016-10-02 21:41:48 +00:00
package = mkPackageOption pkgs "opentracker" { };
2016-10-02 21:41:48 +00:00
extraOptions = mkOption {
type = types.separatedString " ";
description = ''
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.
};
};
};
}