Skip to content

Instantly share code, notes, and snippets.

@benley
Created May 22, 2015 20:08
Show Gist options
  • Select an option

  • Save benley/389126b26d2602df02b1 to your computer and use it in GitHub Desktop.

Select an option

Save benley/389126b26d2602df02b1 to your computer and use it in GitHub Desktop.
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