ef176dcf7e
conversions were done using https://github.com/pennae/nix-doc-munge using (probably) rev f34e145 running nix-doc-munge nixos/**/*.nix nix-doc-munge --import nixos/**/*.nix the tool ensures that only changes that could affect the generated manual *but don't* are committed, other changes require manual review and are discarded.
45 lines
1.2 KiB
Nix
45 lines
1.2 KiB
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
let
|
|
cfg = config.services.opentracker;
|
|
in {
|
|
options.services.opentracker = {
|
|
enable = mkEnableOption (lib.mdDoc "opentracker");
|
|
|
|
package = mkOption {
|
|
type = types.package;
|
|
description = lib.mdDoc ''
|
|
opentracker package to use
|
|
'';
|
|
default = pkgs.opentracker;
|
|
defaultText = literalExpression "pkgs.opentracker";
|
|
};
|
|
|
|
extraOptions = mkOption {
|
|
type = types.separatedString " ";
|
|
description = lib.mdDoc ''
|
|
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.
|
|
};
|
|
};
|
|
};
|
|
}
|
|
|