Created
May 22, 2015 20:08
-
-
Save benley/389126b26d2602df02b1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let | |
| lib = import <nixpkgs/lib>; | |
| docker_registry = https://docker-registry.example.com; | |
| master_zk_url = zk://zookeeper.example:2181/mesos; | |
| attributes = { | |
| os = "nixos"; | |
| host = null; # hostname | |
| rack = "1"; # us-east-1a etc | |
| instance_type = null; # t2.medium etc | |
| instance_id = null; # i-eb321ba8 etc | |
| }; | |
| attrstring = | |
| lib.concatStringsSep ";" (lib.mapAttrsToList | |
| (k: v: "${k}:${v}") | |
| (lib.filterAttrs (k: v: v != null) attributes)); | |
| in | |
| { | |
| network.description = "mesos slave"; | |
| mesos_slave = { config, pkgs, ... }: | |
| { networking.firewall.enable = false; | |
| virtualisation.docker = { | |
| enable = true; | |
| extraOptions = ''--registry-mirror=${docker_registry}''; | |
| }; | |
| services.mesos.slave = { | |
| inherit attributes; | |
| enable = true; | |
| master = master_zk_url; | |
| extraCmdLineOptions = [ | |
| "--executor_registration_timeout=3mins" | |
| "--strict=false" | |
| #"--attributes=${attrstring}" | |
| ]; | |
| }; | |
| }; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment