2015-04-29 22:02:09 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.services.brltty;
|
|
|
|
|
|
|
|
in {
|
|
|
|
|
|
|
|
options = {
|
|
|
|
|
|
|
|
services.brltty.enable = mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = false;
|
|
|
|
description = "Whether to enable the BRLTTY daemon.";
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
|
|
|
|
systemd.services.brltty = {
|
2015-09-09 10:51:22 +01:00
|
|
|
description = "Braille Device Support";
|
|
|
|
unitConfig = {
|
|
|
|
Documentation = "http://mielke.cc/brltty/";
|
|
|
|
DefaultDependencies = "no";
|
|
|
|
RequiresMountsFor = "${pkgs.brltty}/var/lib/brltty";
|
|
|
|
};
|
2015-04-29 22:02:09 +01:00
|
|
|
serviceConfig = {
|
2015-09-09 10:51:22 +01:00
|
|
|
ExecStart = "${pkgs.brltty}/bin/brltty --no-daemon";
|
2016-10-22 21:12:30 +01:00
|
|
|
Type = "notify";
|
2015-09-09 10:51:22 +01:00
|
|
|
TimeoutStartSec = 5;
|
|
|
|
TimeoutStopSec = 10;
|
|
|
|
Restart = "always";
|
|
|
|
RestartSec = 30;
|
|
|
|
Nice = -10;
|
|
|
|
OOMScoreAdjust = -900;
|
|
|
|
ProtectHome = "read-only";
|
|
|
|
ProtectSystem = "full";
|
|
|
|
SystemCallArchitectures = "native";
|
2015-04-29 22:02:09 +01:00
|
|
|
};
|
2016-12-18 10:47:12 +00:00
|
|
|
wants = [ "systemd-udev-settle.service" ];
|
|
|
|
after = [ "local-fs.target" "systemd-udev-settle.service" ];
|
2015-04-29 22:02:09 +01:00
|
|
|
before = [ "sysinit.target" ];
|
|
|
|
wantedBy = [ "sysinit.target" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|