2020-04-24 23:36:52 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.services.safeeyes;
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
###### interface
|
|
|
|
|
|
|
|
options = {
|
|
|
|
|
|
|
|
services.safeeyes = {
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
enable = mkEnableOption (lib.mdDoc "the safeeyes OSGi service");
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
###### implementation
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
|
2021-09-23 15:35:13 +00:00
|
|
|
environment.systemPackages = [ pkgs.safeeyes ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
systemd.user.services.safeeyes = {
|
|
|
|
description = "Safeeyes";
|
|
|
|
|
|
|
|
wantedBy = [ "graphical-session.target" ];
|
|
|
|
partOf = [ "graphical-session.target" ];
|
|
|
|
|
2020-11-03 02:18:15 +00:00
|
|
|
startLimitIntervalSec = 350;
|
|
|
|
startLimitBurst = 10;
|
2020-04-24 23:36:52 +00:00
|
|
|
serviceConfig = {
|
|
|
|
ExecStart = ''
|
|
|
|
${pkgs.safeeyes}/bin/safeeyes
|
|
|
|
'';
|
|
|
|
Restart = "on-failure";
|
|
|
|
RestartSec = 3;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|