1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6 cfg = config.services.brltty;
7
8in {
9
10 options = {
11
12 services.brltty.enable = mkOption {
13 type = types.bool;
14 default = false;
15 description = "Whether to enable the BRLTTY daemon.";
16 };
17
18 };
19
20 config = mkIf cfg.enable {
21
22 systemd.services.brltty = {
23 description = "Braille Device Support";
24 unitConfig = {
25 Documentation = "http://mielke.cc/brltty/";
26 DefaultDependencies = "no";
27 RequiresMountsFor = "${pkgs.brltty}/var/lib/brltty";
28 };
29 serviceConfig = {
30 ExecStart = "${pkgs.brltty}/bin/brltty --no-daemon";
31 Type = "simple"; # Change to notidy after next releae
32 TimeoutStartSec = 5;
33 TimeoutStopSec = 10;
34 Restart = "always";
35 RestartSec = 30;
36 Nice = -10;
37 OOMScoreAdjust = -900;
38 ProtectHome = "read-only";
39 ProtectSystem = "full";
40 SystemCallArchitectures = "native";
41 };
42 before = [ "sysinit.target" ];
43 wantedBy = [ "sysinit.target" ];
44 };
45
46 };
47
48}