summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorBram Duvigneau <bram@bramd.nl>2015-04-29 23:02:09 +0200
committerBram Duvigneau <bram@bramd.nl>2015-04-29 23:02:09 +0200
commit9a535b90238938e38bdb0498e9f2558ace782a4f (patch)
tree7dacf0ad8ef2c406c84fc1def42b92fad936befb /nixos
parent06cf9a961371180f88529bdae3e784bc41b39f89 (diff)
downloadnixpkgs-9a535b90238938e38bdb0498e9f2558ace782a4f.tar
nixpkgs-9a535b90238938e38bdb0498e9f2558ace782a4f.tar.gz
nixpkgs-9a535b90238938e38bdb0498e9f2558ace782a4f.tar.bz2
nixpkgs-9a535b90238938e38bdb0498e9f2558ace782a4f.tar.lz
nixpkgs-9a535b90238938e38bdb0498e9f2558ace782a4f.tar.xz
nixpkgs-9a535b90238938e38bdb0498e9f2558ace782a4f.tar.zst
nixpkgs-9a535b90238938e38bdb0498e9f2558ace782a4f.zip
Added BRLTTY package
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/module-list.nix1
-rw-r--r--nixos/modules/services/hardware/brltty.nix42
2 files changed, 43 insertions, 0 deletions
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" ];
+    };
+
+  };
+
+}