at 23.11-pre 756 B view raw
1{ config, lib, pkgs, ... }: 2 3with lib; 4 5let 6 7 cfg = config.services.safeeyes; 8 9in 10 11{ 12 13 ###### interface 14 15 options = { 16 17 services.safeeyes = { 18 19 enable = mkEnableOption (lib.mdDoc "the safeeyes OSGi service"); 20 21 }; 22 23 }; 24 25 ###### implementation 26 27 config = mkIf cfg.enable { 28 29 environment.systemPackages = [ pkgs.safeeyes ]; 30 31 systemd.user.services.safeeyes = { 32 description = "Safeeyes"; 33 34 wantedBy = [ "graphical-session.target" ]; 35 partOf = [ "graphical-session.target" ]; 36 37 startLimitIntervalSec = 350; 38 startLimitBurst = 10; 39 serviceConfig = { 40 ExecStart = '' 41 ${pkgs.safeeyes}/bin/safeeyes 42 ''; 43 Restart = "on-failure"; 44 RestartSec = 3; 45 }; 46 }; 47 48 }; 49}