diff options
Diffstat (limited to 'nixos/modules/services/hardware/brltty.nix')
-rw-r--r-- | nixos/modules/services/hardware/brltty.nix | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/nixos/modules/services/hardware/brltty.nix b/nixos/modules/services/hardware/brltty.nix new file mode 100644 index 00000000000..d6c05a3d620 --- /dev/null +++ b/nixos/modules/services/hardware/brltty.nix @@ -0,0 +1,42 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.services.brltty; + + stateDir = "/run/brltty"; + + pidFile = "${stateDir}/brltty.pid"; + +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 console driver"; + preStart = '' + mkdir -p ${stateDir} + ''; + serviceConfig = { + ExecStart = "${pkgs.brltty}/bin/brltty --pid-file=${pidFile}"; + Type = "forking"; + PIDFile = pidFile; + }; + before = [ "sysinit.target" ]; + wantedBy = [ "sysinit.target" ]; + }; + + }; + +} |