grafana-alloy: don't build the frontend twice
[NixPkgs.git] / nixos / modules / services / misc / safeeyes.nix
blob38970fd77527fe4d1ab4711876c20a79354a4f05
1 { config, lib, pkgs, ... }:
3 with lib;
5 let
7   cfg = config.services.safeeyes;
9 in
13   ###### interface
15   options = {
17     services.safeeyes = {
19       enable = mkEnableOption "the safeeyes OSGi service";
21     };
23   };
25   ###### implementation
27   config = mkIf cfg.enable {
29     environment.systemPackages = [ pkgs.safeeyes ];
31     systemd.user.services.safeeyes = {
32       description = "Safeeyes";
34       wantedBy = [ "graphical-session.target" ];
35       partOf   = [ "graphical-session.target" ];
37       startLimitIntervalSec = 350;
38       startLimitBurst = 10;
39       serviceConfig = {
40         ExecStart = ''
41           ${pkgs.safeeyes}/bin/safeeyes
42         '';
43         Restart = "on-failure";
44         RestartSec = 3;
45       };
46     };
48   };