From 9a535b90238938e38bdb0498e9f2558ace782a4f Mon Sep 17 00:00:00 2001 From: Bram Duvigneau Date: Wed, 29 Apr 2015 23:02:09 +0200 Subject: [PATCH 1/3] Added BRLTTY package --- nixos/modules/module-list.nix | 1 + nixos/modules/services/hardware/brltty.nix | 42 ++++++++++++++++++++++ pkgs/tools/misc/brltty/default.nix | 33 +++++++++++++++++ pkgs/top-level/all-packages.nix | 3 ++ 4 files changed, 79 insertions(+) create mode 100644 nixos/modules/services/hardware/brltty.nix create mode 100644 pkgs/tools/misc/brltty/default.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index 61cc551f435..e1af98f0da6 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -152,6 +152,7 @@ ./services/hardware/actkbd.nix ./services/hardware/amd-hybrid-graphics.nix ./services/hardware/bluetooth.nix + ./services/hardware/brltty.nix ./services/hardware/freefall.nix ./services/hardware/nvidia-optimus.nix ./services/hardware/pcscd.nix 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" ]; + }; + + }; + +} diff --git a/pkgs/tools/misc/brltty/default.nix b/pkgs/tools/misc/brltty/default.nix new file mode 100644 index 00000000000..4201fb25f98 --- /dev/null +++ b/pkgs/tools/misc/brltty/default.nix @@ -0,0 +1,33 @@ +{ stdenv, fetchurl, pkgconfig, alsaSupport, alsaLib ? null, bluez }: + +assert alsaSupport -> alsaLib != null; + +stdenv.mkDerivation rec { + name = "brltty-5.2"; + + src = fetchurl { + url = "http://brltty.com/archive/${name}.tar.gz"; + sha256 = "1zaab5pxkqrv081n23p3am445d30gk0km4azqdirvcpw9z15q0cz"; + }; + + buildInputs = [ pkgconfig alsaLib bluez ] + ++ stdenv.lib.optional alsaSupport alsaLib; + + meta = { + description = "Access software for a blind person using a braille display"; + longDescription = '' + BRLTTY is a background process (daemon) which provides access to the Linux/Unix + console (when in text mode) for a blind person using a refreshable braille display. + It drives the braille display, and provides complete screen review functionality. + Some speech capability has also been incorporated. + ''; + homepage = http://www.brltty.com/; + license = stdenv.lib.licenses.gpl2; + maintainers = [ stdenv.lib.maintainers.bramd ]; + platforms = stdenv.lib.platforms.all; + }; + + patchPhase = '' + substituteInPlace configure --replace /sbin/ldconfig ldconfig + ''; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 332811bcafe..3855dc8b4a9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -715,6 +715,9 @@ let brasero = callPackage ../tools/cd-dvd/brasero { }; + brltty = callPackage ../tools/misc/brltty { + alsaSupport = (!stdenv.isDarwin); + }; bro = callPackage ../applications/networking/ids/bro { }; bsod = callPackage ../misc/emulators/bsod { }; From 70241a53d011468a8aa75ea860aaf980901a2e55 Mon Sep 17 00:00:00 2001 From: Bram Duvigneau Date: Wed, 29 Apr 2015 23:30:18 +0200 Subject: [PATCH 2/3] Added Bram Duvigneau to maintainers --- lib/maintainers.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/maintainers.nix b/lib/maintainers.nix index f0e87507ceb..8f148ba91c4 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -41,6 +41,7 @@ bodil = "Bodil Stokke "; boothead = "Ben Ford "; bosu = "Boris Sukholitko "; + bramd = "Bram Duvigneau "; bstrik = "Berno Strik "; calrama = "Moritz Maxeiner "; campadrenalin = "Philip Horger "; From e37dbea9423cc65f6edae362fb7043f50cf27373 Mon Sep 17 00:00:00 2001 From: Bram Duvigneau Date: Fri, 1 May 2015 00:08:32 +0200 Subject: [PATCH 3/3] Document the brltty servicve in release notes --- nixos/doc/manual/release-notes/rl-unstable.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nixos/doc/manual/release-notes/rl-unstable.xml b/nixos/doc/manual/release-notes/rl-unstable.xml index cdbd074e782..6b2cf55bb8d 100644 --- a/nixos/doc/manual/release-notes/rl-unstable.xml +++ b/nixos/doc/manual/release-notes/rl-unstable.xml @@ -15,9 +15,9 @@ Following new services were added since the last release: - + +brltty + When upgrading from a previous release, please be aware of the