diff options
author | BjornMelgaard <melgaardbjorn@gmail.com> | 2018-04-04 23:15:16 +0300 |
---|---|---|
committer | BjornMelgaard <melgaardbjorn@gmail.com> | 2018-04-10 21:19:13 +0300 |
commit | 2f4a220130951312c939c3bf20e80bcee16aee28 (patch) | |
tree | 967cb39fdb9311c95363103c2ac9d0ec9118587a /nixos/modules/services/misc | |
parent | 3bbe655c440034ffe925cd99f6ae6dd1ec36f5f8 (diff) | |
download | nixlib-2f4a220130951312c939c3bf20e80bcee16aee28.tar nixlib-2f4a220130951312c939c3bf20e80bcee16aee28.tar.gz nixlib-2f4a220130951312c939c3bf20e80bcee16aee28.tar.bz2 nixlib-2f4a220130951312c939c3bf20e80bcee16aee28.tar.lz nixlib-2f4a220130951312c939c3bf20e80bcee16aee28.tar.xz nixlib-2f4a220130951312c939c3bf20e80bcee16aee28.tar.zst nixlib-2f4a220130951312c939c3bf20e80bcee16aee28.zip |
safeeyes: add module
Diffstat (limited to 'nixos/modules/services/misc')
-rw-r--r-- | nixos/modules/services/misc/safeeyes.nix | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/nixos/modules/services/misc/safeeyes.nix b/nixos/modules/services/misc/safeeyes.nix new file mode 100644 index 000000000000..a1d304d290fd --- /dev/null +++ b/nixos/modules/services/misc/safeeyes.nix @@ -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"; + }; + }; + + }; +} |