@@ -354,6 +354,16 @@ in {
354354 type = types.lines;
355355 };
356356 };
357+
358+ beacon = {
359+ enable = mkEnableOption "Whether to enable graphite beacon.";
360+
361+ config = mkOption {
362+ description = "Graphite beacon configuration.";
363+ default = {};
364+ type = types.attrs;
365+ };
366+ };
357367 };
358368
359369 ###### implementation
@@ -535,10 +545,25 @@ in {
535545 environment.systemPackages = [ pkgs.pythonPackages.graphite_pager ];
536546 })
537547
548+ (mkIf cfg.beacon.enable {
549+ systemd.services.graphite-beacon = {
550+ description = "Grpahite Beacon Alerting Daemon";
551+ wantedBy = [ "multi-user.target" ];
552+ serviceConfig = {
553+ ExecStart = ''
554+ ${pkgs.pythonPackages.graphite_beacon}/bin/graphite-beacon \
555+ --config ${pkgs.writeText "graphite-beacon.json" (builtins.toJSON cfg.beacon.config)}
556+ '';
557+ User = "graphite";
558+ Group = "graphite";
559+ };
560+ };
561+ })
562+
538563 (mkIf (
539564 cfg.carbon.enableCache || cfg.carbon.enableAggregator || cfg.carbon.enableRelay ||
540565 cfg.web.enable || cfg.api.enable ||
541− cfg.seyren.enable || cfg.pager.enable
566+ cfg.seyren.enable || cfg.pager.enable || cfg.beacon.enable
542567 ) {
543568 users.extraUsers = singleton {
544569 name = "graphite";