safeeyes: add module

This commit is contained in:
BjornMelgaard 2018-04-04 23:15:16 +03:00
parent 3bbe655c44
commit 2f4a220130
3 changed files with 51 additions and 2 deletions

View File

@ -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

View File

@ -0,0 +1,48 @@
{ 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";
};
};
};
}

View File

@ -30,11 +30,11 @@ in buildPythonApplication rec {
# 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
'';