1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-06-25 10:36:36 +03:00
nixpkgs/nixos/modules/services/misc/safeeyes.nix

52 lines
746 B
Nix
Raw Normal View History

{
config,
lib,
pkgs,
...
}:
2018-04-04 23:15:16 +03:00
let
cfg = config.services.safeeyes;
in
{
###### interface
options = {
services.safeeyes = {
enable = lib.mkEnableOption "the safeeyes OSGi service";
2018-04-04 23:15:16 +03:00
};
};
###### implementation
config = lib.mkIf cfg.enable {
2018-04-04 23:15:16 +03:00
environment.systemPackages = [ pkgs.safeeyes ];
2018-04-04 23:15:16 +03:00
systemd.user.services.safeeyes = {
description = "Safeeyes";
wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
2018-04-04 23:15:16 +03:00
startLimitIntervalSec = 350;
startLimitBurst = 10;
2018-04-04 23:15:16 +03:00
serviceConfig = {
ExecStart = ''
${pkgs.safeeyes}/bin/safeeyes
'';
2018-04-10 21:06:38 +03:00
Restart = "on-failure";
2018-04-04 23:15:16 +03:00
RestartSec = 3;
};
};
};
}