2018-04-04 21:15:16 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.services.safeeyes;
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
###### interface
|
|
|
|
|
|
|
|
options = {
|
|
|
|
|
|
|
|
services.safeeyes = {
|
|
|
|
|
2020-04-20 19:05:26 +01:00
|
|
|
enable = mkEnableOption "the safeeyes OSGi service";
|
2018-04-04 21:15:16 +01:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
###### implementation
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
|
|
|
|
systemd.user.services.safeeyes = {
|
|
|
|
description = "Safeeyes";
|
|
|
|
|
|
|
|
wantedBy = [ "graphical-session.target" ];
|
|
|
|
partOf = [ "graphical-session.target" ];
|
|
|
|
|
|
|
|
serviceConfig = {
|
|
|
|
ExecStart = ''
|
|
|
|
${pkgs.safeeyes}/bin/safeeyes
|
|
|
|
'';
|
2018-04-10 19:06:38 +01:00
|
|
|
Restart = "on-failure";
|
2018-04-04 21:15:16 +01:00
|
|
|
RestartSec = 3;
|
2018-04-10 19:06:38 +01:00
|
|
|
StartLimitInterval = 350;
|
|
|
|
StartLimitBurst = 10;
|
2018-04-04 21:15:16 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|