nixos: add chronos service
This commit is contained in:
@@ -171,6 +171,7 @@
|
|||||||
bosun = 161;
|
bosun = 161;
|
||||||
kubernetes = 162;
|
kubernetes = 162;
|
||||||
peerflix = 163;
|
peerflix = 163;
|
||||||
|
chronos = 164;
|
||||||
|
|
||||||
# When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!
|
# When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!
|
||||||
|
|
||||||
|
|||||||
@@ -292,6 +292,7 @@
|
|||||||
./services/networking/znc.nix
|
./services/networking/znc.nix
|
||||||
./services/printing/cupsd.nix
|
./services/printing/cupsd.nix
|
||||||
./services/scheduling/atd.nix
|
./services/scheduling/atd.nix
|
||||||
|
./services/scheduling/chronos.nix
|
||||||
./services/scheduling/cron.nix
|
./services/scheduling/cron.nix
|
||||||
./services/scheduling/fcron.nix
|
./services/scheduling/fcron.nix
|
||||||
./services/search/elasticsearch.nix
|
./services/search/elasticsearch.nix
|
||||||
|
|||||||
@@ -0,0 +1,54 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.services.chronos;
|
||||||
|
|
||||||
|
in {
|
||||||
|
|
||||||
|
###### interface
|
||||||
|
|
||||||
|
options.services.chronos = {
|
||||||
|
enable = mkOption {
|
||||||
|
description = "Whether to enable graphite web frontend.";
|
||||||
|
default = false;
|
||||||
|
type = types.uniq types.bool;
|
||||||
|
};
|
||||||
|
|
||||||
|
httpPort = mkOption {
|
||||||
|
description = "Chronos listening port";
|
||||||
|
default = 8080;
|
||||||
|
type = types.int;
|
||||||
|
};
|
||||||
|
|
||||||
|
master = mkOption {
|
||||||
|
description = "Chronos mesos master zookeeper address";
|
||||||
|
default = "zk://${head cfg.zookeeperHosts}/mesos";
|
||||||
|
type = types.str;
|
||||||
|
};
|
||||||
|
|
||||||
|
zookeeperHosts = mkOption {
|
||||||
|
description = "Chronos mesos zookepper addresses";
|
||||||
|
default = [ "localhost:2181" ];
|
||||||
|
type = types.listOf types.str;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
###### implementation
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
systemd.services.chronos = {
|
||||||
|
description = "Chronos Service";
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
after = [ "network-interfaces.target" "zookeeper.service" ];
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = "${pkgs.chronos}/bin/chronos --master ${cfg.master} --zk_hosts ${concatStringsSep "," cfg.zookeeperHosts} --http_port ${toString cfg.httpPort}";
|
||||||
|
User = "chronos";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
users.extraUsers.chronos.uid = config.ids.uids.chronos;
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user