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 | |
parent | b34d63e722981bb81a88659e3d5f978223d17a9d (diff) | |
download | nixlib-74b40e9a433066ae6a87a32a85a229a1a4d4adbf.tar nixlib-74b40e9a433066ae6a87a32a85a229a1a4d4adbf.tar.gz nixlib-74b40e9a433066ae6a87a32a85a229a1a4d4adbf.tar.bz2 nixlib-74b40e9a433066ae6a87a32a85a229a1a4d4adbf.tar.lz nixlib-74b40e9a433066ae6a87a32a85a229a1a4d4adbf.tar.xz nixlib-74b40e9a433066ae6a87a32a85a229a1a4d4adbf.tar.zst nixlib-74b40e9a433066ae6a87a32a85a229a1a4d4adbf.zip |
Add marathon mesos framework
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/misc/ids.nix | 1 | ||||
-rw-r--r-- | nixos/modules/module-list.nix | 1 | ||||
-rw-r--r-- | nixos/modules/services/scheduling/marathon.nix | 58 |
3 files changed, 60 insertions, 0 deletions
diff --git a/nixos/modules/misc/ids.nix b/nixos/modules/misc/ids.nix index f3cda7b95416..390bab907b37 100644 --- a/nixos/modules/misc/ids.nix +++ b/nixos/modules/misc/ids.nix @@ -178,6 +178,7 @@ nylon = 168; apache-kafka = 169; panamax = 170; + marathon = 171; # When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399! diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 8ce1c6c20a36..e0255bbbe28e 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -315,6 +315,7 @@ ./services/scheduling/chronos.nix ./services/scheduling/cron.nix ./services/scheduling/fcron.nix + ./services/scheduling/marathon.nix ./services/search/elasticsearch.nix ./services/search/solr.nix ./services/security/clamav.nix diff --git a/nixos/modules/services/scheduling/marathon.nix b/nixos/modules/services/scheduling/marathon.nix new file mode 100644 index 000000000000..8513d1174c38 --- /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"; + }; + }; +} |