1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6
7 cfg = config.services.safeeyes;
8
9in
10
11{
12
13 ###### interface
14
15 options = {
16
17 services.safeeyes = {
18
19 enable = mkOption {
20 default = false;
21 description = "Whether to enable the safeeyes OSGi service";
22 };
23
24 };
25
26 };
27
28 ###### implementation
29
30 config = mkIf cfg.enable {
31
32 systemd.user.services.safeeyes = {
33 description = "Safeeyes";
34
35 wantedBy = [ "graphical-session.target" ];
36 partOf = [ "graphical-session.target" ];
37
38 serviceConfig = {
39 ExecStart = ''
40 ${pkgs.safeeyes}/bin/safeeyes
41 '';
42 Restart = "on-failure";
43 RestartSec = 3;
44 StartLimitInterval = 350;
45 StartLimitBurst = 10;
46 };
47 };
48
49 };
50}