2020-04-24 23:36:52 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.services.safeeyes;
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
###### interface
|
|
|
|
|
|
|
|
options = {
|
|
|
|
|
|
|
|
services.safeeyes = {
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
enable = mkEnableOption "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;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|