From d45a3fbdc9e8def061d435cd3400c0ea2105a2a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Mon, 11 Jan 2010 21:56:01 +0000 Subject: [PATCH] Adding the pcscd daemon (this daemon manages smartcard reader drivers), and offers a common interface to programs dealing with smartcards (like users of the opensc lib). svn path=/nixos/trunk/; revision=19360 --- modules/module-list.nix | 1 + modules/services/hardware/pcscd.nix | 46 +++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 modules/services/hardware/pcscd.nix diff --git a/modules/module-list.nix b/modules/module-list.nix index 40b31082902..d140f7ad335 100644 --- a/modules/module-list.nix +++ b/modules/module-list.nix @@ -47,6 +47,7 @@ ./services/databases/postgresql.nix ./services/hardware/acpid.nix ./services/hardware/hal.nix + ./services/hardware/pcscd.nix ./services/hardware/udev.nix ./services/logging/klogd.nix ./services/logging/syslogd.nix diff --git a/modules/services/hardware/pcscd.nix b/modules/services/hardware/pcscd.nix new file mode 100644 index 00000000000..45684e17416 --- /dev/null +++ b/modules/services/hardware/pcscd.nix @@ -0,0 +1,46 @@ +{ config, pkgs, ... }: + +with pkgs.lib; + +{ + + ###### interface + + options = { + + services.pcscd = { + + enable = mkOption { + default = false; + description = "Whether to enable the PCSC-Lite daemon."; + }; + + }; + + }; + + + ###### implementation + + config = mkIf config.services.pcscd.enable { + + jobs.pcscd = + { description = "PCSC-Lite daemon"; + + startOn = "started udev"; + + daemonType = "daemon"; + + # Add to the drivers directory the only drivers we have by now: ccid + preStart = '' + mkdir -p /var/lib/pcsc + rm -Rf /var/lib/pcsc/drivers + ln -s ${pkgs.ccid}/pcsc/drivers /var/lib/pcsc/ + ''; + + exec = "${pkgs.pcsclite}/sbin/pcscd"; + }; + + }; + +}