at 17.09-beta 1.1 kB view raw
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 = "notify"; 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 wants = [ "systemd-udev-settle.service" ]; 43 after = [ "local-fs.target" "systemd-udev-settle.service" ]; 44 before = [ "sysinit.target" ]; 45 wantedBy = [ "sysinit.target" ]; 46 }; 47 48 }; 49 50}