summary refs log tree commit diff
path: root/nixos/modules/services/hardware/brltty.nix
blob: 1266e8f81e5b44a18f8deb88ef591dbc19b4b163 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{ 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 = {
      description = "Braille Device Support";
      unitConfig = {
        Documentation = "http://mielke.cc/brltty/";
        DefaultDependencies = "no";
        RequiresMountsFor = "${pkgs.brltty}/var/lib/brltty";
      };
      serviceConfig = {
        ExecStart = "${pkgs.brltty}/bin/brltty --no-daemon";
        Type = "notify";
        TimeoutStartSec = 5;
        TimeoutStopSec = 10;
        Restart = "always";
        RestartSec = 30;
        Nice = -10;
        OOMScoreAdjust = -900;
        ProtectHome = "read-only";
        ProtectSystem = "full";
        SystemCallArchitectures = "native";
      };
      wants = [ "systemd-udev-settle.service" ];
      after = [ "local-fs.target" "systemd-udev-settle.service" ];
      before = [ "sysinit.target" ];
      wantedBy = [ "sysinit.target" ];
    };

  };

}