1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-24 14:41:17 +00:00
nixpkgs/nixos/modules/services/torrent/opentracker.nix
Joachim Fasting f9f354faad
nixos/modules: use defaultText where applicable
Primarily to fix rendering of these default values in the manual but
it's also nice to avoid having to eval these things just to build the
manual.
2016-11-21 16:35:15 +01:00

46 lines
1.1 KiB
Nix

{ 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;
defaultText = "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.
};
};
};
}