mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 23:13:19 +00:00
nixos: add chronos service
This commit is contained in:
parent
665cc41e5c
commit
099eabb490
@ -171,6 +171,7 @@
|
||||
bosun = 161;
|
||||
kubernetes = 162;
|
||||
peerflix = 163;
|
||||
chronos = 164;
|
||||
|
||||
# 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/printing/cupsd.nix
|
||||
./services/scheduling/atd.nix
|
||||
./services/scheduling/chronos.nix
|
||||
./services/scheduling/cron.nix
|
||||
./services/scheduling/fcron.nix
|
||||
./services/search/elasticsearch.nix
|
||||
|
54
nixos/modules/services/scheduling/chronos.nix
Normal file
54
nixos/modules/services/scheduling/chronos.nix
Normal file
@ -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;
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user