2018-04-04 22:15:16 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.services.safeeyes;
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
###### interface
|
|
|
|
|
|
|
|
options = {
|
|
|
|
|
|
|
|
services.safeeyes = {
|
|
|
|
|
2020-04-20 20:05:26 +02:00
|
|
|
enable = mkEnableOption "the safeeyes OSGi service";
|
2018-04-04 22:15:16 +02:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
###### implementation
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
|
2021-09-22 13:12:27 +02:00
|
|
|
environment.systemPackages = [ pkgs.safeeyes ];
|
|
|
|
|
2018-04-04 22:15:16 +02:00
|
|
|
systemd.user.services.safeeyes = {
|
|
|
|
description = "Safeeyes";
|
|
|
|
|
|
|
|
wantedBy = [ "graphical-session.target" ];
|
|
|
|
partOf = [ "graphical-session.target" ];
|
|
|
|
|
2021-09-22 13:07:33 +02:00
|
|
|
path = [ pkgs.alsa-utils ];
|
|
|
|
|
2020-09-09 09:31:27 +02:00
|
|
|
startLimitIntervalSec = 350;
|
|
|
|
startLimitBurst = 10;
|
2018-04-04 22:15:16 +02:00
|
|
|
serviceConfig = {
|
|
|
|
ExecStart = ''
|
|
|
|
${pkgs.safeeyes}/bin/safeeyes
|
|
|
|
'';
|
2018-04-10 20:06:38 +02:00
|
|
|
Restart = "on-failure";
|
2018-04-04 22:15:16 +02:00
|
|
|
RestartSec = 3;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|