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