diff options
author | Bram Duvigneau <bram@bramd.nl> | 2015-04-29 23:02:09 +0200 |
---|---|---|
committer | Bram Duvigneau <bram@bramd.nl> | 2015-04-29 23:02:09 +0200 |
commit | 9a535b90238938e38bdb0498e9f2558ace782a4f (patch) | |
tree | 7dacf0ad8ef2c406c84fc1def42b92fad936befb /nixos/modules/services/hardware | |
parent | 06cf9a961371180f88529bdae3e784bc41b39f89 (diff) | |
download | nixlib-9a535b90238938e38bdb0498e9f2558ace782a4f.tar nixlib-9a535b90238938e38bdb0498e9f2558ace782a4f.tar.gz nixlib-9a535b90238938e38bdb0498e9f2558ace782a4f.tar.bz2 nixlib-9a535b90238938e38bdb0498e9f2558ace782a4f.tar.lz nixlib-9a535b90238938e38bdb0498e9f2558ace782a4f.tar.xz nixlib-9a535b90238938e38bdb0498e9f2558ace782a4f.tar.zst nixlib-9a535b90238938e38bdb0498e9f2558ace782a4f.zip |
Added BRLTTY package
Diffstat (limited to 'nixos/modules/services/hardware')
-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 000000000000..d6c05a3d620c --- /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" ]; + }; + + }; + +} |