safeeyes: add module

Changed files
+51 -2
nixos
modules
pkgs
applications
misc
safeeyes
+1
nixos/modules/module-list.nix
···
./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
+48
nixos/modules/services/misc/safeeyes.nix
···
+
{ 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
+
'';
+
RestartSec = 3;
+
Restart = "always";
+
};
+
};
+
+
};
+
}
+2 -2
pkgs/applications/misc/safeeyes/default.nix
···
# patch smartpause plugin
postPatch = ''
sed -i \
-
-e 's!xprintidle!${xprintidle-ng}/bin/xprintidle-ng!g' \
+
-e 's!xprintidle!xprintidle-ng!g' \
safeeyes/plugins/smartpause/plugin.py
sed -i \
-
-e 's!xprintidle!${xprintidle-ng}/bin/xprintidle-ng!g' \
+
-e 's!xprintidle!xprintidle-ng!g' \
safeeyes/plugins/smartpause/config.json
'';