diff options
author | rushmorem <rushmore@webenchanter.com> | 2015-02-19 11:32:02 +0200 |
---|---|---|
committer | rushmorem <rushmore@webenchanter.com> | 2015-02-19 13:30:00 +0200 |
commit | 74b40e9a433066ae6a87a32a85a229a1a4d4adbf (patch) | |
tree | 6457c23a018e9aad8e11482d9fe0951a642a2602 /nixos/modules/services/scheduling | |
parent | b34d63e722981bb81a88659e3d5f978223d17a9d (diff) |
Add marathon mesos framework
Diffstat (limited to 'nixos/modules/services/scheduling')
-rw-r--r-- | nixos/modules/services/scheduling/marathon.nix | 58 |
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"; + }; + }; +} |