git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #9745 from bramd/brltty
cb90dbfArseniy Seroka
nixos/modules/services/hardware/brltty.nix+17−11
@@ -4,10 +4,6 @@ with lib;
4
4
5let
5let
6 cfg = config.services.brltty;
6 cfg = config.services.brltty;
7−
8− stateDir = "/run/brltty";
9−
10− pidFile = "${stateDir}/brltty.pid";
11
7
12in {
8in {
13
9
@@ -24,14 +20,24 @@ in {
24 config = mkIf cfg.enable {
20 config = mkIf cfg.enable {
25
21
26 systemd.services.brltty = {
22 systemd.services.brltty = {
27− description = "Braille console driver";
23+ description = "Braille Device Support";
28− preStart = ''
24+ unitConfig = {
29− mkdir -p ${stateDir}
25+ Documentation = "http://mielke.cc/brltty/";
26+ DefaultDependencies = "no";
27+ RequiresMountsFor = "${pkgs.brltty}/var/lib/brltty";
30− '';
28+ };
31 serviceConfig = {
29 serviceConfig = {
32− ExecStart = "${pkgs.brltty}/bin/brltty --pid-file=${pidFile}";
30+ ExecStart = "${pkgs.brltty}/bin/brltty --no-daemon";
33− Type = "forking";
31+ Type = "simple"; # Change to notidy after next releae
34− PIDFile = pidFile;
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";
35 };
41 };
36 before = [ "sysinit.target" ];
42 before = [ "sysinit.target" ];
37 wantedBy = [ "sysinit.target" ];
43 wantedBy = [ "sysinit.target" ];