opentracker service: init
This commit is contained in:
parent
400910c1f7
commit
e9039c8b5a
|
@ -473,6 +473,7 @@
|
||||||
./services/system/uptimed.nix
|
./services/system/uptimed.nix
|
||||||
./services/torrent/deluge.nix
|
./services/torrent/deluge.nix
|
||||||
./services/torrent/flexget.nix
|
./services/torrent/flexget.nix
|
||||||
|
./services/torrent/opentracker.nix
|
||||||
./services/torrent/peerflix.nix
|
./services/torrent/peerflix.nix
|
||||||
./services/torrent/transmission.nix
|
./services/torrent/transmission.nix
|
||||||
./services/ttys/agetty.nix
|
./services/ttys/agetty.nix
|
||||||
|
|
44
nixos/modules/services/torrent/opentracker.nix
Normal file
44
nixos/modules/services/torrent/opentracker.nix
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.services.opentracker;
|
||||||
|
in {
|
||||||
|
options.services.opentracker = {
|
||||||
|
enable = mkEnableOption "opentracker";
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
description = ''
|
||||||
|
opentracker package to use
|
||||||
|
'';
|
||||||
|
default = pkgs.opentracker;
|
||||||
|
};
|
||||||
|
|
||||||
|
extraOptions = mkOption {
|
||||||
|
type = types.separatedString " ";
|
||||||
|
description = ''
|
||||||
|
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.
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue