diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 3953856b2f1..77c648c39dc 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -4130,4 +4130,9 @@ github = "zzamboni"; name = "Diego Zamboni"; }; + srghma = { + email = "srghma@gmail.com"; + github = "srghma"; + name = "Sergei Khoma"; + }; } diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 63e463370d1..3a9a2bf8661 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -366,6 +366,7 @@ ./services/misc/ripple-data-api.nix ./services/misc/rogue.nix ./services/misc/serviio.nix + ./services/misc/safeeyes.nix ./services/misc/siproxd.nix ./services/misc/snapper.nix ./services/misc/sonarr.nix diff --git a/nixos/modules/services/misc/safeeyes.nix b/nixos/modules/services/misc/safeeyes.nix new file mode 100644 index 00000000000..1a33971d922 --- /dev/null +++ b/nixos/modules/services/misc/safeeyes.nix @@ -0,0 +1,50 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + + cfg = config.services.safeeyes; + +in + +{ + + ###### interface + + options = { + + services.safeeyes = { + + enable = mkOption { + default = false; + description = "Whether to enable the safeeyes OSGi service"; + }; + + }; + + }; + + ###### implementation + + config = mkIf cfg.enable { + + systemd.user.services.safeeyes = { + description = "Safeeyes"; + + wantedBy = [ "graphical-session.target" ]; + partOf = [ "graphical-session.target" ]; + + serviceConfig = { + ExecStart = '' + ${pkgs.safeeyes}/bin/safeeyes + ''; + Restart = "on-failure"; + RestartSec = 3; + StartLimitInterval = 350; + StartLimitBurst = 10; + }; + }; + + }; +} diff --git a/pkgs/applications/misc/safeeyes/default.nix b/pkgs/applications/misc/safeeyes/default.nix new file mode 100644 index 00000000000..7c3bda8c06d --- /dev/null +++ b/pkgs/applications/misc/safeeyes/default.nix @@ -0,0 +1,71 @@ +{ lib, python3Packages, gobjectIntrospection, libappindicator-gtk3, libnotify, gtk3, gnome3, xprintidle-ng, wrapGAppsHook, gdk_pixbuf, shared-mime-info, librsvg +}: + +let inherit (python3Packages) python buildPythonApplication fetchPypi; + +in buildPythonApplication rec { + name = "${pname}-${version}"; + pname = "safeeyes"; + version = "2.0.2"; + namePrefix = ""; + + src = fetchPypi { + inherit pname version; + sha256 = "1fx6zd4hnbc7gdpac6r7smxwdl1bifaxx3mnx0wrqfvhpnwr1ybv"; + }; + + buildInputs = [ + gtk3 + gobjectIntrospection + gnome3.defaultIconTheme + gnome3.adwaita-icon-theme + ]; + + nativeBuildInputs = [ + wrapGAppsHook + ]; + + propagatedBuildInputs = with python3Packages; [ + Babel + psutil + xlib + pygobject3 + dbus-python + + libappindicator-gtk3 + libnotify + xprintidle-ng + ]; + + # patch smartpause plugin + postPatch = '' + sed -i \ + -e 's!xprintidle!xprintidle-ng!g' \ + safeeyes/plugins/smartpause/plugin.py + + sed -i \ + -e 's!xprintidle!xprintidle-ng!g' \ + safeeyes/plugins/smartpause/config.json + ''; + + preFixup = '' + gappsWrapperArgs+=( + --prefix XDG_DATA_DIRS : "${gdk_pixbuf}/share" + --prefix XDG_DATA_DIRS : "${shared-mime-info}/share" + --prefix XDG_DATA_DIRS : "${librsvg}/share" + + # safeeyes images + --prefix XDG_DATA_DIRS : "$out/lib/${python.libPrefix}/site-packages/usr/share" + ) + ''; + + doCheck = false; # no tests + + meta = { + homepage = http://slgobinath.github.io/SafeEyes; + description = "Protect your eyes from eye strain using this simple and beautiful, yet extensible break reminder. A Free and Open Source Linux alternative to EyeLeo"; + license = lib.licenses.gpl3; + maintainers = with lib.maintainers; [ srghma ]; + platforms = lib.platforms.all; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9bc5658f7f4..0a6b87dc2ed 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -629,9 +629,9 @@ with pkgs; encryptr = callPackage ../tools/security/encryptr { gconf = gnome2.GConf; - }; + }; - enchive = callPackage ../tools/security/enchive { }; + enchive = callPackage ../tools/security/enchive { }; enpass = callPackage ../tools/security/enpass { }; @@ -4723,6 +4723,8 @@ with pkgs; safe-rm = callPackage ../tools/system/safe-rm { }; + safeeyes = callPackage ../applications/misc/safeeyes { }; + salt = callPackage ../tools/admin/salt {}; salut_a_toi = callPackage ../applications/networking/instant-messengers/salut-a-toi {};