summary refs log tree commit diff
path: root/nixos/modules/services/scheduling/marathon.nix
diff options
context:
space:
mode:
authorrushmorem <rushmore@webenchanter.com>2015-02-19 11:32:02 +0200
committerrushmorem <rushmore@webenchanter.com>2015-02-19 13:30:00 +0200
commit74b40e9a433066ae6a87a32a85a229a1a4d4adbf (patch)
tree6457c23a018e9aad8e11482d9fe0951a642a2602 /nixos/modules/services/scheduling/marathon.nix
parentb34d63e722981bb81a88659e3d5f978223d17a9d (diff)
downloadnixpkgs-74b40e9a433066ae6a87a32a85a229a1a4d4adbf.tar
nixpkgs-74b40e9a433066ae6a87a32a85a229a1a4d4adbf.tar.gz
nixpkgs-74b40e9a433066ae6a87a32a85a229a1a4d4adbf.tar.bz2
nixpkgs-74b40e9a433066ae6a87a32a85a229a1a4d4adbf.tar.lz
nixpkgs-74b40e9a433066ae6a87a32a85a229a1a4d4adbf.tar.xz
nixpkgs-74b40e9a433066ae6a87a32a85a229a1a4d4adbf.tar.zst
nixpkgs-74b40e9a433066ae6a87a32a85a229a1a4d4adbf.zip
Add marathon mesos framework
Diffstat (limited to 'nixos/modules/services/scheduling/marathon.nix')
-rw-r--r--nixos/modules/services/scheduling/marathon.nix58
1 files changed, 58 insertions, 0 deletions
diff --git a/nixos/modules/services/scheduling/marathon.nix b/nixos/modules/services/scheduling/marathon.nix
new file mode 100644
index 00000000000..8513d1174c3
--- /dev/null
+++ b/nixos/modules/services/scheduling/marathon.nix
@@ -0,0 +1,58 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+
+  cfg = config.services.marathon;
+
+in {
+
+  ###### interface
+
+  options.services.marathon = {
+    enable = mkOption {
+      description = "Whether to enable the marathon mesos framework.";
+      default = false;
+      type = types.uniq types.bool;
+    };
+
+    httpPort = mkOption {
+      description = "Marathon listening port";
+      default = 8080;
+      type = types.int;
+    };
+
+    master = mkOption {
+      description = "Marathon mesos master zookeeper address";
+      default = "zk://${head cfg.zookeeperHosts}/mesos";
+      type = types.str;
+    };
+
+    zookeeperHosts = mkOption {
+      description = "Marathon mesos zookepper addresses";
+      default = [ "localhost:2181" ];
+      type = types.listOf types.str;
+    };
+  };
+
+  ###### implementation
+
+  config = mkIf cfg.enable {
+    systemd.services.marathon = {
+      description = "Marathon Service";
+      wantedBy = [ "multi-user.target" ];
+      after = [ "network-interfaces.target" "zookeeper.service" "mesos-master.service" "mesos-slave.service" ];
+
+      serviceConfig = {
+        ExecStart = "${pkgs.marathon}/bin/marathon --master ${cfg.master} --zk zk://${head cfg.zookeeperHosts}/marathon";
+        User = "marathon";
+      };
+    };
+
+    users.extraUsers.marathon = {
+      uid = config.ids.uids.marathon;
+      description = "Marathon mesos framework user";
+    };
+  };
+}