summaryrefslogtreecommitdiffstats
path: root/makefu/3modules/opentracker.nix
diff options
context:
space:
mode:
authorlassulus <lass@aidsballs.de>2016-08-24 08:49:16 +0200
committerlassulus <lass@aidsballs.de>2016-08-24 08:49:16 +0200
commit662222f8c422ac8fa3daba8bc26ab5d5cd37fda1 (patch)
tree93d5629203803e06b6f9a60219ac7b0ce315399c /makefu/3modules/opentracker.nix
parenta545159c08c6a748299111184ba5a34b40d7af67 (diff)
parent56e8681fd2d5a77fe539e5506b4b8f23bc0f4261 (diff)
Merge remote-tracking branch 'gum/master'
Diffstat (limited to 'makefu/3modules/opentracker.nix')
-rw-r--r--makefu/3modules/opentracker.nix55
1 files changed, 55 insertions, 0 deletions
diff --git a/makefu/3modules/opentracker.nix b/makefu/3modules/opentracker.nix
new file mode 100644
index 000000000..8847fc09a
--- /dev/null
+++ b/makefu/3modules/opentracker.nix
@@ -0,0 +1,55 @@
+{ config, lib, pkgs, ... }:
+
+with config.krebs.lib;
+let
+ cfg = config.makefu.opentracker;
+
+ out = {
+ options.makefu.opentracker = api;
+ config = lib.mkIf cfg.enable imp;
+ };
+
+ api = {
+ enable = mkEnableOption "opentracker";
+
+ package = mkOption {
+ type = types.package;
+ default = pkgs.opentracker;
+ };
+
+ args = mkOption {
+ type = types.string;
+ description = ''
+ see https://erdgeist.org/arts/software/opentracker/ for all params
+ '';
+ default = "";
+ };
+
+ user = mkOption {
+ description = ''
+ user which will run opentracker. by default opentracker drops all
+ privileges and runs in chroot after starting up as root.
+ '';
+ type = types.str;
+ default = "root";
+ };
+ };
+
+ imp = {
+ systemd.services.opentracker = {
+ description = "opentracker server";
+ after = [ "network.target" ];
+ wantedBy = [ "multi-user.target" ];
+ restartIfChanged = true;
+ serviceConfig = {
+ Type = "simple";
+ ExecStart = "${cfg.package}/bin/opentracker ${cfg.args}";
+ PrivateTmp = true;
+ WorkingDirectory = "/tmp";
+ User = "${cfg.user}";
+ };
+ };
+ };
+in
+out
+