@@ -0,0 +1,54 @@
1+{ config, lib, pkgs, ... }:
6+ cfg = config.services.chronos;
12+ options.services.chronos = {
14+ description = "Whether to enable graphite web frontend.";
16+ type = types.uniq types.bool;
19+ httpPort = mkOption {
20+ description = "Chronos listening port";
26+ description = "Chronos mesos master zookeeper address";
27+ default = "zk://${head cfg.zookeeperHosts}/mesos";
31+ zookeeperHosts = mkOption {
32+ description = "Chronos mesos zookepper addresses";
33+ default = [ "localhost:2181" ];
34+ type = types.listOf types.str;
38+ ###### implementation
40+ config = mkIf cfg.enable {
41+ systemd.services.chronos = {
42+ description = "Chronos Service";
43+ wantedBy = [ "multi-user.target" ];
44+ after = [ "network-interfaces.target" "zookeeper.service" ];
47+ ExecStart = "${pkgs.chronos}/bin/chronos --master ${cfg.master} --zk_hosts ${concatStringsSep "," cfg.zookeeperHosts} --http_port ${toString cfg.httpPort}";
52+ users.extraUsers.chronos.uid = config.ids.uids.chronos;